aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-07-23 12:36:13 +0100
committerglozow <gloriajzhao@gmail.com>2024-07-24 10:38:34 +0100
commit6f49548670d5ab12a963c0ada3b315c544b95e2e (patch)
treeb53ab62c89f5a9331fe931453fc44899dfc47d13 /src
parentfa0b5d68823b69f4861b002bbfac2fd36ed46356 (diff)
[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.
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp2
1 files changed, 0 insertions, 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());
}