Browse Source

Check consistency of private keys

Reported by onlineproof on IRC: Bitcoin does not verify whether private
keys and public keys correspond, when loading a wallet.
0.8
Pieter Wuille 13 years ago
parent
commit
b25cc627a3
  1. 2
      src/db.cpp

2
src/db.cpp

@ -862,6 +862,8 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
ssValue >> pkey; ssValue >> pkey;
key.SetPubKey(vchPubKey); key.SetPubKey(vchPubKey);
key.SetPrivKey(pkey); key.SetPrivKey(pkey);
if (key.GetPubKey() != vchPubKey)
return DB_CORRUPT;
} }
else else
{ {

Loading…
Cancel
Save