Skip to content

Commit fa2bcc4

Browse files
author
MarcoFalke
committedJan 19, 2022
Run coin.IsSpent only once in a row
Follow-up to commit 64e4963
1 parent 06b6369 commit fa2bcc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/validation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ void CChainState::MaybeUpdateMempoolForReorg(
384384
auto it2 = m_mempool->mapTx.find(txin.prevout.hash);
385385
if (it2 != m_mempool->mapTx.end())
386386
continue;
387-
const Coin &coin = CoinsTip().AccessCoin(txin.prevout);
387+
const Coin& coin{CoinsTip().AccessCoin(txin.prevout)};
388388
assert(!coin.IsSpent());
389389
const auto mempool_spend_height{m_chain.Tip()->nHeight + 1};
390-
if (coin.IsSpent() || (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY)) {
390+
if (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY) {
391391
return true;
392392
}
393393
}

0 commit comments

Comments
 (0)
Please sign in to comment.