From bc68788317a4ece16f0cfb0cb7eb1e0e220cbc6f Mon Sep 17 00:00:00 2001 From: phantomcircuit Date: Sat, 12 Oct 2013 23:44:28 -0700 Subject: [PATCH] comment explaining new wallet format for key/wkey entries --- src/walletdb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index f7edd084..d31db5e4 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -317,6 +317,12 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, ssValue >> wkey; pkey = wkey.vchPrivKey; } + + // Old wallets store keys as "key" [pubkey] => [privkey] + // ... which was slow for wallets with lots of keys, because the public key is re-derived from the private key + // using EC operations as a checksum. + // Newer wallets store keys as "key"[pubkey] => [privkey][hash(pubkey,privkey)], which is much faster while + // remaining backwards-compatible. try { ssValue >> hash;