mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-16 18:39:18 +00:00
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:
parent
1b6d8f3fca
commit
c1c6de6ad4
@ -879,6 +879,8 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
CPrivKey pkey;
|
||||
ssValue >> pkey;
|
||||
key.SetPrivKey(pkey);
|
||||
if (key.GetPubKey() != vchPubKey)
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user