From 6f49548670d5ab12a963c0ada3b315c544b95e2e Mon Sep 17 00:00:00 2001 From: glozow Date: Tue, 23 Jul 2024 12:36:13 +0100 Subject: [PATCH] [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. --- src/net_processing.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index c241994763..29349e51c4 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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()); }