diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-16 20:12:38 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-16 20:12:38 -0700 |
commit | 796e7b7aecd84a5c0cd7098c2f770ef8fba732e3 (patch) | |
tree | 1abfc8aaa832090071cf96ea611685d7af86a64f /src/walletdb.h | |
parent | 5a8a4be28949fd0531ae5ea8e21c713373e22c01 (diff) | |
parent | bc68788317a4ece16f0cfb0cb7eb1e0e220cbc6f (diff) | |
download | bitcoin-796e7b7aecd84a5c0cd7098c2f770ef8fba732e3.tar.xz |
Merge pull request #2950 from pstratem/walletload
Walletload
Diffstat (limited to 'src/walletdb.h')
-rw-r--r-- | src/walletdb.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/walletdb.h b/src/walletdb.h index 09ebebe5ac..2d01a5cf74 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -93,8 +93,14 @@ public: if (!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; - - return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false); + + // hash pubkey/privkey to accelerate wallet load + std::vector<unsigned char> vchKey; + vchKey.reserve(vchPubKey.size() + vchPrivKey.size()); + vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end()); + vchKey.insert(vchKey.end(), vchPrivKey.begin(), vchPrivKey.end()); + + return Write(std::make_pair(std::string("key"), vchPubKey), std::make_pair(vchPrivKey, Hash(vchKey.begin(), vchKey.end())), false); } bool WriteCryptedKey(const CPubKey& vchPubKey, |