diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-14 18:58:15 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-14 18:59:07 +0100 |
commit | f8b48ed2979cf76550d3889c0da4211a4e45f235 (patch) | |
tree | a09ffe507716f7ee4ece5f6db367c22b2c9a3ba1 | |
parent | 1aac1448dee95c6d2455274021b00bb8c853fd32 (diff) | |
parent | 16ec9044d1f2eda7c5c86fcb73c839e17fb35db3 (diff) |
Merge pull request #3426
16ec904 Don't create empty transactions when reading corrupted wallet (Wladimir J. van der Laan)
-rw-r--r-- | src/walletdb.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 2dc6594e93..9c5bddba60 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -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", |