#include <db_cxx.h>
-class CTxIndex;
+class CAccount;
+class CAccountingEntry;
+class CAddress;
+class CBlockLocator;
class CDiskBlockIndex;
class CDiskTxPos;
+class CMasterKey;
class COutPoint;
-class CAddress;
-class CWalletTx;
+class CTxIndex;
class CWallet;
-class CAccount;
-class CAccountingEntry;
-class CBlockLocator;
-
+class CWalletTx;
extern unsigned int nWalletDBUpdated;
extern DbEnv dbenv;
return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
}
- bool ReadCScript(const uint160 &hash, std::vector<unsigned char>& data)
+ // Support for BIP 0013 : see https://en.bitcoin.it/wiki/BIP_0013
+ bool ReadCScript(const uint160 &hash, CScript& redeemScript)
{
- data.clear();
- return Read(std::make_pair(std::string("cscript"), hash), data);
+ redeemScript.clear();
+ return Read(std::make_pair(std::string("cscript"), hash), redeemScript);
}
- bool WriteCScript(const uint160& hash, const std::vector<unsigned char>& data)
+ bool WriteCScript(const uint160& hash, const CScript& redeemScript)
{
nWalletDBUpdated++;
- return Write(std::make_pair(std::string("cscript"), hash), data, false);
+ return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false);
}
bool WriteBestBlock(const CBlockLocator& locator)