Merge branch 'FSM' of https://github.com/jl777/komodo into mastertest
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user