Skip to content

Commit

Permalink
[refactor] use exists() instead of mapTx.find()
Browse files Browse the repository at this point in the history
  • Loading branch information
glozow committed Sep 1, 2023
1 parent c2a80b1 commit 0c356aa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ void Chainstate::MaybeUpdateMempoolForReorg(
// If the transaction spends any coinbase outputs, it must be mature.
if (it->GetSpendsCoinbase()) {
for (const CTxIn& txin : tx.vin) {
auto it2 = m_mempool->mapTx.find(txin.prevout.hash);
if (it2 != m_mempool->mapTx.end())
continue;
if (m_mempool->exists(GenTxid::Txid(txin.prevout.hash))) continue;
const Coin& coin{CoinsTip().AccessCoin(txin.prevout)};
assert(!coin.IsSpent());
const auto mempool_spend_height{m_chain.Tip()->nHeight + 1};
Expand Down

0 comments on commit 0c356aa

Please sign in to comment.