Skip to content

Commit e4ffabb

Browse files
committed
net_processing: don't add txids to m_tx_inventory_known_filter
We no longer have m_recently_announced_invs, so there is no need to add txids to m_tx_inventory_known_filter to dedupe that filter.
1 parent 6ec1809 commit e4ffabb

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ struct Peer {
265265
std::unique_ptr<CBloomFilter> m_bloom_filter PT_GUARDED_BY(m_bloom_filter_mutex) GUARDED_BY(m_bloom_filter_mutex){nullptr};
266266

267267
mutable RecursiveMutex m_tx_inventory_mutex;
268-
/** A filter of all the txids and wtxids that the peer has announced to
268+
/** A filter of all the (w)txids that the peer has announced to
269269
* us or we have announced to the peer. We use this to avoid announcing
270-
* the same txid/wtxid to a peer that already has the transaction. */
270+
* the same (w)txid to a peer that already has the transaction. */
271271
CRollingBloomFilter m_tx_inventory_known_filter GUARDED_BY(m_tx_inventory_mutex){50000, 0.000001};
272272
/** Set of transaction ids we still have to announce (txid for
273273
* non-wtxid-relay peers, wtxid for wtxid-relay peers). We use the
@@ -4089,14 +4089,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
40894089

40904090
const uint256& hash = peer->m_wtxid_relay ? wtxid : txid;
40914091
AddKnownTx(*peer, hash);
4092-
if (peer->m_wtxid_relay && txid != wtxid) {
4093-
// Insert txid into m_tx_inventory_known_filter, even for
4094-
// wtxidrelay peers. This prevents re-adding of
4095-
// unconfirmed parents to the recently_announced
4096-
// filter, when a child tx is requested. See
4097-
// ProcessGetData().
4098-
AddKnownTx(*peer, txid);
4099-
}
41004092

41014093
LOCK(cs_main);
41024094

@@ -5748,14 +5740,6 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
57485740
vInv.clear();
57495741
}
57505742
tx_relay->m_tx_inventory_known_filter.insert(hash);
5751-
if (peer->m_wtxid_relay && hash != txinfo.tx->GetHash()) {
5752-
// Insert txid into m_tx_inventory_known_filter, even for
5753-
// wtxidrelay peers. This prevents re-adding of
5754-
// unconfirmed parents to the recently_announced
5755-
// filter, when a child tx is requested. See
5756-
// ProcessGetData().
5757-
tx_relay->m_tx_inventory_known_filter.insert(txinfo.tx->GetHash());
5758-
}
57595743
}
57605744

57615745
// Ensure we'll respond to GETDATA requests for anything we've just announced

0 commit comments

Comments
 (0)