diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-05-14 19:07:52 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-05-24 19:58:12 +0200 |
commit | fd61d6f5068cf92d34569862b4225f177049a4f0 (patch) | |
tree | 5556094bda3a7162535b9352b67016e620bb9a77 /src/walletdb.h | |
parent | f04017f702e36563b9ba05b3fede216767de580a (diff) |
Encapsulate public keys in CPubKey
Diffstat (limited to 'src/walletdb.h')
-rw-r--r-- | src/walletdb.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/walletdb.h b/src/walletdb.h index dee1750262..de2b7f3aae 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -59,27 +59,27 @@ public: return Erase(std::make_pair(std::string("tx"), hash)); } - bool ReadKey(const std::vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey) + bool ReadKey(const CPubKey& vchPubKey, CPrivKey& vchPrivKey) { vchPrivKey.clear(); - return Read(std::make_pair(std::string("key"), vchPubKey), vchPrivKey); + return Read(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey); } - bool WriteKey(const std::vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey) + bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey) { nWalletDBUpdated++; - return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false); + return Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false); } - bool WriteCryptedKey(const std::vector<unsigned char>& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, bool fEraseUnencryptedKey = true) + bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, bool fEraseUnencryptedKey = true) { nWalletDBUpdated++; - if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) + if (!Write(std::make_pair(std::string("ckey"), vchPubKey.Raw()), vchCryptedSecret, false)) return false; if (fEraseUnencryptedKey) { - Erase(std::make_pair(std::string("key"), vchPubKey)); - Erase(std::make_pair(std::string("wkey"), vchPubKey)); + Erase(std::make_pair(std::string("key"), vchPubKey.Raw())); + Erase(std::make_pair(std::string("wkey"), vchPubKey.Raw())); } return true; } @@ -120,10 +120,10 @@ public: return Read(std::string("defaultkey"), vchPubKey); } - bool WriteDefaultKey(const std::vector<unsigned char>& vchPubKey) + bool WriteDefaultKey(const CPubKey& vchPubKey) { nWalletDBUpdated++; - return Write(std::string("defaultkey"), vchPubKey); + return Write(std::string("defaultkey"), vchPubKey.Raw()); } bool ReadPool(int64 nPool, CKeyPool& keypool) |