Skip to content

Commit

Permalink
Check consistency of private keys
Browse files Browse the repository at this point in the history
Reported by onlineproof on IRC: Bitcoin does not verify whether private
keys and public keys correspond, when loading a wallet.
  • Loading branch information
sipa committed Jan 25, 2012
1 parent 1240a1b commit b25cc62
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/db.cpp
Expand Up @@ -862,6 +862,8 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
ssValue >> pkey;
key.SetPubKey(vchPubKey);
key.SetPrivKey(pkey);
if (key.GetPubKey() != vchPubKey)
return DB_CORRUPT;
}
else
{
Expand Down

0 comments on commit b25cc62

Please sign in to comment.