Skip to content

Commit 9cd8caf

Browse files
glozowTheCharlatan
authored andcommitted
[refactor] use exists() instead of mapTx.find()
1 parent 1480469 commit 9cd8caf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/validation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,7 @@ void Chainstate::MaybeUpdateMempoolForReorg(
362362
// If the transaction spends any coinbase outputs, it must be mature.
363363
if (it->GetSpendsCoinbase()) {
364364
for (const CTxIn& txin : tx.vin) {
365-
auto it2 = m_mempool->mapTx.find(txin.prevout.hash);
366-
if (it2 != m_mempool->mapTx.end())
367-
continue;
365+
if (m_mempool->exists(GenTxid::Txid(txin.prevout.hash))) continue;
368366
const Coin& coin{CoinsTip().AccessCoin(txin.prevout)};
369367
assert(!coin.IsSpent());
370368
const auto mempool_spend_height{m_chain.Tip()->nHeight + 1};

0 commit comments

Comments
 (0)