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.
This commit is contained in:
Pieter Wuille
2012-01-25 03:05:16 +01:00
committed by Luke Dashjr
parent 1b6d8f3fca
commit c1c6de6ad4

View File

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