aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-19 16:56:25 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-19 16:55:53 +0100
commitfa2bcc4e42e7fed61727b3de4019e9702d4090ce (patch)
tree74daf852f4ad475ff38e967800cd47c9b4c008aa
parent06b6369766137756648b3cb62c8f385cca234e69 (diff)
Run coin.IsSpent only once in a row
Follow-up to commit 64e4963c635ec3a73a5fa3f32f6ec08e70609f60
-rw-r--r--src/validation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index fff7cfc07b..b3d989e150 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;
}
}