From fa2bcc4e42e7fed61727b3de4019e9702d4090ce Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 19 Jan 2022 16:56:25 +0100 Subject: [PATCH] Run coin.IsSpent only once in a row Follow-up to commit 64e4963c635ec3a73a5fa3f32f6ec08e70609f60 --- src/validation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index fff7cfc07b8..b3d989e1501 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -384,10 +384,10 @@ void CChainState::MaybeUpdateMempoolForReorg( auto it2 = m_mempool->mapTx.find(txin.prevout.hash); if (it2 != m_mempool->mapTx.end()) continue; - const Coin &coin = CoinsTip().AccessCoin(txin.prevout); + const Coin& coin{CoinsTip().AccessCoin(txin.prevout)}; assert(!coin.IsSpent()); const auto mempool_spend_height{m_chain.Tip()->nHeight + 1}; - if (coin.IsSpent() || (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY)) { + if (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY) { return true; } }