|
|
@ -33,21 +33,10 @@ private: |
|
|
|
CWalletDB(const CWalletDB&); |
|
|
|
CWalletDB(const CWalletDB&); |
|
|
|
void operator=(const CWalletDB&); |
|
|
|
void operator=(const CWalletDB&); |
|
|
|
public: |
|
|
|
public: |
|
|
|
bool ReadName(const std::string& strAddress, std::string& strName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strName = ""; |
|
|
|
|
|
|
|
return Read(std::make_pair(std::string("name"), strAddress), strName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WriteName(const std::string& strAddress, const std::string& strName); |
|
|
|
bool WriteName(const std::string& strAddress, const std::string& strName); |
|
|
|
|
|
|
|
|
|
|
|
bool EraseName(const std::string& strAddress); |
|
|
|
bool EraseName(const std::string& strAddress); |
|
|
|
|
|
|
|
|
|
|
|
bool ReadTx(uint256 hash, CWalletTx& wtx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return Read(std::make_pair(std::string("tx"), hash), wtx); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WriteTx(uint256 hash, const CWalletTx& wtx) |
|
|
|
bool WriteTx(uint256 hash, const CWalletTx& wtx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWalletDBUpdated++; |
|
|
|
nWalletDBUpdated++; |
|
|
@ -60,12 +49,6 @@ public: |
|
|
|
return Erase(std::make_pair(std::string("tx"), hash)); |
|
|
|
return Erase(std::make_pair(std::string("tx"), hash)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool ReadKey(const CPubKey& vchPubKey, CPrivKey& vchPrivKey) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
vchPrivKey.clear(); |
|
|
|
|
|
|
|
return Read(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey) |
|
|
|
bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWalletDBUpdated++; |
|
|
|
nWalletDBUpdated++; |
|
|
@ -91,13 +74,6 @@ public: |
|
|
|
return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); |
|
|
|
return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Support for BIP 0013 : see https://en.bitcoin.it/wiki/BIP_0013
|
|
|
|
|
|
|
|
bool ReadCScript(const uint160 &hash, CScript& redeemScript) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
redeemScript.clear(); |
|
|
|
|
|
|
|
return Read(std::make_pair(std::string("cscript"), hash), redeemScript); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WriteCScript(const uint160& hash, const CScript& redeemScript) |
|
|
|
bool WriteCScript(const uint160& hash, const CScript& redeemScript) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWalletDBUpdated++; |
|
|
|
nWalletDBUpdated++; |
|
|
@ -121,12 +97,6 @@ public: |
|
|
|
return Write(std::string("orderposnext"), nOrderPosNext); |
|
|
|
return Write(std::string("orderposnext"), nOrderPosNext); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool ReadDefaultKey(std::vector<unsigned char>& vchPubKey) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
vchPubKey.clear(); |
|
|
|
|
|
|
|
return Read(std::string("defaultkey"), vchPubKey); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WriteDefaultKey(const CPubKey& vchPubKey) |
|
|
|
bool WriteDefaultKey(const CPubKey& vchPubKey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nWalletDBUpdated++; |
|
|
|
nWalletDBUpdated++; |
|
|
|