From: Pieter Wuille Date: Wed, 25 Jan 2012 02:05:16 +0000 (+0100) Subject: Check consistency of private keys X-Git-Tag: v0.4.0-unstable~129^2~1^2^2~2^2^2~74 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=c1c6de6ad4f92c6628dccc271fe4c661e450d130 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. --- diff --git a/src/db.cpp b/src/db.cpp index f9a7d6c..bd31bd7 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 {