aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-01-26 19:26:34 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-01-26 19:26:43 +0100
commit91f43a33f8fb9d87bd2b6a7a279e4a6f5c1e3c96 (patch)
tree70cc726b22b1dab4948485ded3a6f59b13529438 /src/db.cpp
parent4c932cca6f579bfb11e0144415c3004d382b8e42 (diff)
Full checking of all loaded keys
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 9ad05ba780..07f58ef38a 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -862,7 +862,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
ssValue >> pkey;
key.SetPubKey(vchPubKey);
key.SetPrivKey(pkey);
- if (key.GetPubKey() != vchPubKey)
+ if (key.GetPubKey() != vchPubKey || !key.IsValid())
return DB_CORRUPT;
}
else
@@ -871,6 +871,8 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
ssValue >> wkey;
key.SetPubKey(vchPubKey);
key.SetPrivKey(wkey.vchPrivKey);
+ if (key.GetPubKey() != vchPubKey || !key.IsValid())
+ return DB_CORRUPT;
}
if (!pwallet->LoadKey(key))
return DB_CORRUPT;