mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-29 16:24:22 +00:00
Merge pull request #3426
16ec904 Don't create empty transactions when reading corrupted wallet (Wladimir J. van der Laan)
This commit is contained in:
commit
f8b48ed297
@ -357,16 +357,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
||||
{
|
||||
uint256 hash;
|
||||
ssKey >> hash;
|
||||
CWalletTx& wtx = pwallet->mapWallet[hash];
|
||||
CWalletTx wtx;
|
||||
ssValue >> wtx;
|
||||
CValidationState state;
|
||||
if (CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid())
|
||||
wtx.BindWallet(pwallet);
|
||||
else
|
||||
{
|
||||
pwallet->mapWallet.erase(hash);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Undo serialize changes in 31600
|
||||
if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703)
|
||||
@ -391,6 +388,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
||||
if (wtx.nOrderPos == -1)
|
||||
wss.fAnyUnordered = true;
|
||||
|
||||
pwallet->mapWallet[hash] = wtx;
|
||||
//// debug print
|
||||
//LogPrintf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
|
||||
//LogPrintf(" %12"PRId64" %s %s %s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user