aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-10-16 20:12:38 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-10-16 20:12:38 -0700
commit796e7b7aecd84a5c0cd7098c2f770ef8fba732e3 (patch)
tree1abfc8aaa832090071cf96ea611685d7af86a64f /src/walletdb.h
parent5a8a4be28949fd0531ae5ea8e21c713373e22c01 (diff)
parentbc68788317a4ece16f0cfb0cb7eb1e0e220cbc6f (diff)
downloadbitcoin-796e7b7aecd84a5c0cd7098c2f770ef8fba732e3.tar.xz
Merge pull request #2950 from pstratem/walletload
Walletload
Diffstat (limited to 'src/walletdb.h')
-rw-r--r--src/walletdb.h10
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,