X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwalletdb.h;h=b5b7f02dc8f0b3a90c36393f20d7f600042330f7;hb=52c85881648d3381c29da10925c06cbd083cc570;hp=9d57c937b64095f5ad22a6cb56af976fb16ecc5c;hpb=77a43545b4491b9703d803765da9059d2bdd5aaa;p=novacoin.git diff --git a/src/walletdb.h b/src/walletdb.h index 9d57c93..b5b7f02 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -86,11 +86,13 @@ public: bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta) { nWalletDBUpdated++; - if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; - return Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false); + if(!Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false)) + return false; + + return true; } bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector& vchCryptedSecret, const CKeyMetadata &keyMeta) @@ -117,6 +119,17 @@ public: return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); } + bool EraseMasterKey(unsigned int nID) + { + nWalletDBUpdated++; + return Erase(std::make_pair(std::string("mkey"), nID)); + } + + bool EraseCryptedKey(const CPubKey& vchPubKey) + { + return Erase(std::make_pair(std::string("ckey"), vchPubKey.Raw())); + } + bool WriteCScript(const uint160& hash, const CScript& redeemScript) { nWalletDBUpdated++; @@ -129,6 +142,12 @@ public: return Write(std::make_pair(std::string("watchs"), dest), '1'); } + bool EraseWatchOnly(const CScript &dest) + { + nWalletDBUpdated++; + return Erase(std::make_pair(std::string("watchs"), dest)); + } + bool WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++; @@ -169,25 +188,6 @@ public: return Erase(std::make_pair(std::string("pool"), nPool)); } - // Settings are no longer stored in wallet.dat; these are - // used only for backwards compatibility: - template - bool ReadSetting(const std::string& strKey, T& value) - { - return Read(std::make_pair(std::string("setting"), strKey), value); - } - template - bool WriteSetting(const std::string& strKey, const T& value) - { - nWalletDBUpdated++; - return Write(std::make_pair(std::string("setting"), strKey), value); - } - bool EraseSetting(const std::string& strKey) - { - nWalletDBUpdated++; - return Erase(std::make_pair(std::string("setting"), strKey)); - } - bool WriteMinVersion(int nVersion) { return Write(std::string("minversion"), nVersion);