From bd9006623c2ae9e1489111d64c87f5a3e7d29a94 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 11 Sep 2022 22:41:03 -0400 Subject: [PATCH] Avoid coredumps in ReacceptWalletTransactions and log the situation, which is possibly caused by corrupt wallet tx data --- src/wallet/wallet.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 85faac38b..e9450161f 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2847,7 +2847,12 @@ void CWallet::ReacceptWalletTransactions() { const uint256& wtxid = item.first; CWalletTx& wtx = item.second; - assert(wtx.GetHash() == wtxid); + if(wtx.GetHash() != wtxid) { + LogPrintf("%s: Something funky going on, skipping this tx. wtx.GetHash() != wtxid (%s != %s)\n", __func__, wtx.GetHash().ToString().c_str(), wtxid.ToString().c_str() ); + continue; + } + // Crashing the node because of this is lame + // assert(wtx.GetHash() == wtxid); int nDepth = wtx.GetDepthInMainChain();