Merge branch 'FSM' of https://github.com/jl777/komodo into mastertest

This commit is contained in:
blackjok3r
2019-01-23 16:57:05 +08:00
61 changed files with 7223 additions and 1530 deletions

View File

@@ -969,6 +969,24 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
deadTxns.clear();
}
if (!deadTxns.empty())
{
int32_t reAdded = 0;
BOOST_FOREACH (uint256& hash, deadTxns) {
if (!EraseTx(hash))
fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str());
uint256 blockhash; CTransaction tx;
if (GetTransaction(hash,tx,blockhash,true))
{
CWalletTx wtx(pwallet,tx);
pwallet->AddToWallet(wtx, true, NULL);
reAdded++;
}
}
fprintf(stderr, "Cleared %lu corrupted transactions from wallet. Readded %i known transactions.\n",deadTxns.size(),reAdded);
deadTxns.clear();
}
if (fNoncriticalErrors && result == DB_LOAD_OK)
result = DB_NONCRITICAL_ERROR;