X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwalletdb.h;h=31d6463a5c84f5533b60c72e8e680dc2d4d6cc9f;hb=1c4fc9052a444c114d9c1501d2c6d1305de650d0;hp=748bee5ec19562fab7137e86b918fabd0dcdae4e;hpb=ac92f740d9fe40de422e8446aa514a254f250f27;p=novacoin.git diff --git a/src/walletdb.h b/src/walletdb.h index 748bee5..31d6463 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -7,6 +7,7 @@ #include "db.h" #include "base58.h" +#include "keystore.h" class CKeyPool; class CAccount; @@ -82,24 +83,22 @@ public: return Erase(std::make_pair(std::string("tx"), hash)); } - bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, int64 nCreateTime) + bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta) { nWalletDBUpdated++; - CKeyMetadata keyMeta(nCreateTime); - if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta, false)) + if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; return Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false); } - bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector& vchCryptedSecret, int64 nCreateTime) + bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector& vchCryptedSecret, const CKeyMetadata &keyMeta) { nWalletDBUpdated++; bool fEraseUnencryptedKey = true; - CKeyMetadata keyMeta(nCreateTime); - if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta, false)) + if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; if (!Write(std::make_pair(std::string("ckey"), vchPubKey.Raw()), vchCryptedSecret, false)) @@ -124,6 +123,12 @@ public: return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false); } + bool WriteWatchOnly(const CScript &dest) + { + nWalletDBUpdated++; + return Write(std::make_pair(std::string("watchs"), dest), '1'); + } + bool WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++;