[refactor] use exists() instead of mapTx.find()

This commit is contained in:
glozow
2023-08-30 15:53:56 +01:00
committed by TheCharlatan
parent 14804699e5
commit 9cd8cafb77

View File

@ -362,9 +362,7 @@ void Chainstate::MaybeUpdateMempoolForReorg(
// If the transaction spends any coinbase outputs, it must be mature. // If the transaction spends any coinbase outputs, it must be mature.
if (it->GetSpendsCoinbase()) { if (it->GetSpendsCoinbase()) {
for (const CTxIn& txin : tx.vin) { for (const CTxIn& txin : tx.vin) {
auto it2 = m_mempool->mapTx.find(txin.prevout.hash); if (m_mempool->exists(GenTxid::Txid(txin.prevout.hash))) continue;
if (it2 != m_mempool->mapTx.end())
continue;
const Coin& coin{CoinsTip().AccessCoin(txin.prevout)}; const Coin& coin{CoinsTip().AccessCoin(txin.prevout)};
assert(!coin.IsSpent()); assert(!coin.IsSpent());
const auto mempool_spend_height{m_chain.Tip()->nHeight + 1}; const auto mempool_spend_height{m_chain.Tip()->nHeight + 1};