aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-01-25 03:05:16 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-01-25 03:05:16 +0100
commitb25cc627a3a44378696bb04f1c5ee4c002963d3e (patch)
treeebdee45f6cefa685428492be184615d0b318df16
parent1240a1b0a82e0e944a6fdcf6ff26001e1bd68904 (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.
-rw-r--r--src/db.cpp2
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
{