aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-01-25 03:05:16 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2012-02-02 17:49:39 -0500
commitc1c6de6ad4f92c6628dccc271fe4c661e450d130 (patch)
treec2f5ddc7cc24f672d9b142982e6674ea5ed2ea9a
parent1b6d8f3fca6aef79ea0ccb26303d982d6da78cd1 (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 f9a7d6c90a..bd31bd7943 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -879,6 +879,8 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
CPrivKey pkey;
ssValue >> pkey;
key.SetPrivKey(pkey);
+ if (key.GetPubKey() != vchPubKey)
+ return DB_CORRUPT;
}
else
{