Mercurial > hg > bitcoin
changeset 1790:970e802a5b28 draft
Full checking of all loaded keys
author | Pieter Wuille <pieter.wuille@gmail.com> |
---|---|
date | Thu, 26 Jan 2012 19:26:34 +0100 |
parents | 45c89fff7595 |
children | 1c70f628322a |
files | src/db.cpp src/key.h |
diffstat | 2 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/db.cpp +++ b/src/db.cpp @@ -862,7 +862,7 @@ 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 @@ 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;