mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge bitcoin/bitcoin#24102: mempool: Run coin.IsSpent only once in a row
fa2bcc4e42
Run coin.IsSpent only once in a row (MarcoFalke) Pull request description: Follow-up to commit64e4963c63
and https://github.com/bitcoin/bitcoin/pull/23976#discussion_r787758193 ACKs for top commit: glozow: utACKfa2bcc4e42
, agree the assertion is sufficient theStack: Code-review ACKfa2bcc4e42
w0xlt: crACKfa2bcc4e42
shaavan: Code Review ACKfa2bcc4e42
brunoerg: crACKfa2bcc4e42
Tree-SHA512: 3be9d6b313bf6bb835f031826c81777b4659118d839001d084e72462391cb64ba81d06a5e07fd21fcfb709a71b08892b23212a98604ce8481da489476b72f072
This commit is contained in:
commit
e3de7cb903
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue