[mempool] always assert coin spent

This is an extremely cheap function (just checks that the coin CTxOut
isn't null) that doesn't need to be gated on check_ratio.
pull/22677/head
glozow 3 years ago
parent bb9078ed51
commit 64e4963c63

@ -660,7 +660,7 @@ void CTxMemPool::removeForReorg(CChainState& active_chainstate, int flags)
if (it2 != mapTx.end())
continue;
const Coin &coin = active_chainstate.CoinsTip().AccessCoin(txin.prevout);
if (m_check_ratio != 0) assert(!coin.IsSpent());
assert(!coin.IsSpent());
unsigned int nMemPoolHeight = active_chainstate.m_chain.Tip()->nHeight + 1;
if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) {
should_remove = true;

Loading…
Cancel
Save