X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.h;h=c8d46d8fe6fddcda0b99f2aca677ecfe3e1b6123;hb=4e87d341f75f13bbd7d108c31c03886fbc4df56f;hp=b89b34e0098b072ebd1c019954e7062a37b39537;hpb=64c7ee7e6b9c059d99aaa493c74a6703c6b0fc80;p=novacoin.git diff --git a/src/db.h b/src/db.h index b89b34e..c8d46d8 100644 --- a/src/db.h +++ b/src/db.h @@ -391,6 +391,25 @@ public: return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false); } + bool WriteCryptedKey(const std::vector& vchPubKey, const std::vector& vchCryptedSecret, bool fEraseUnencryptedKey = true) + { + nWalletDBUpdated++; + if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) + return false; + if (fEraseUnencryptedKey) + { + Erase(std::make_pair(std::string("key"), vchPubKey)); + Erase(std::make_pair(std::string("wkey"), vchPubKey)); + } + return true; + } + + bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey) + { + nWalletDBUpdated++; + return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); + } + bool WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++;