X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.cpp;h=783b079963900cb5800a71d5a22e9b068dfb95f9;hb=4664aae3fe2eba4eec84d20f1e7e701ceeeb49bd;hp=f9a7d6c90a5d64f457e6b4f0bd62c54d0973a11a;hpb=36b1eb763101299a4c4d4dad9d40b8ff70011d11;p=novacoin.git diff --git a/src/db.cpp b/src/db.cpp index f9a7d6c..783b079 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2011 The Bitcoin developers +// Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. @@ -879,12 +879,16 @@ int CWalletDB::LoadWallet(CWallet* pwallet) CPrivKey pkey; ssValue >> pkey; key.SetPrivKey(pkey); + if (key.GetPubKey() != vchPubKey || !key.IsValid()) + return DB_CORRUPT; } else { CWalletKey wkey; ssValue >> wkey; key.SetPrivKey(wkey.vchPrivKey); + if (key.GetPubKey() != vchPubKey || !key.IsValid()) + return DB_CORRUPT; } if (!pwallet->LoadKey(key)) return DB_CORRUPT;