X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwalletdb.h;h=1739693061db888e2ade0941ac7b50f3830c8b00;hb=b032c4a33e27deebe9210347048998ecc4624ee4;hp=0766aa81755e1398c57deca5c3b49a3efea0fa00;hpb=b3190037d970f1bedf6e9e5748cebdfe1fc84cd3;p=novacoin.git diff --git a/src/walletdb.h b/src/walletdb.h index 0766aa8..1739693 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++;