[refactor] combine block vtx loops in BlockConnected

Now that m_txrequest and m_recent_confirmed_transactions are guarded by
the same mutex, there is no benefit to processing them separately.
Instead, just loop through pblock->vtx once.
This commit is contained in:
glozow 2024-07-23 12:36:13 +01:00
parent fa0b5d6882
commit 6f49548670

View File

@ -2123,8 +2123,6 @@ void PeerManagerImpl::BlockConnected(
if (ptx->HasWitness()) {
m_recent_confirmed_transactions.insert(ptx->GetWitnessHash().ToUint256());
}
}
for (const auto& ptx : pblock->vtx) {
m_txrequest.ForgetTxHash(ptx->GetHash());
m_txrequest.ForgetTxHash(ptx->GetWitnessHash());
}