diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-01-25 03:05:16 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-01-25 03:05:16 +0100 |
commit | b25cc627a3a44378696bb04f1c5ee4c002963d3e (patch) | |
tree | ebdee45f6cefa685428492be184615d0b318df16 /src/db.cpp | |
parent | 1240a1b0a82e0e944a6fdcf6ff26001e1bd68904 (diff) |
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.
Diffstat (limited to 'src/db.cpp')
-rw-r--r-- | src/db.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/db.cpp b/src/db.cpp index 8ca783163b..9ad05ba780 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -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 { |