git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
1b6d8f3
)
Check consistency of private keys
author
Pieter Wuille
<pieter.wuille@gmail.com>
Wed, 25 Jan 2012 02:05:16 +0000 (
03:05
+0100)
committer
Luke Dashjr
<luke-jr+git@utopios.org>
Thu, 2 Feb 2012 22:49:39 +0000 (17:49 -0500)
Reported by onlineproof on IRC: Bitcoin does not verify whether private
keys and public keys correspond, when loading a wallet.
src/db.cpp
patch
|
blob
|
history
diff --git
a/src/db.cpp
b/src/db.cpp
index
f9a7d6c
..
bd31bd7
100644
(file)
--- 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
{