mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Update getpeerinfo/-netinfo/TxRelay#m_relay_txs relaytxes docs (for v24 backport)
to the current p2p behavior. We only initialize the Peer::TxRelay m_relay_txs data structure if it isn't an outbound block-relay-only connection and fRelay=true (the peer wishes to receive tx announcements) or we're offering NODE_BLOOM to this peer.
This commit is contained in:
@@ -271,12 +271,7 @@ struct Peer {
|
||||
|
||||
struct TxRelay {
|
||||
mutable RecursiveMutex m_bloom_filter_mutex;
|
||||
/** Whether the peer wishes to receive transaction announcements.
|
||||
*
|
||||
* This is initially set based on the fRelay flag in the received
|
||||
* `version` message. If initially set to false, it can only be flipped
|
||||
* to true if we have offered the peer NODE_BLOOM services and it sends
|
||||
* us a `filterload` or `filterclear` message. See BIP37. */
|
||||
/** Whether we relay transactions to this peer. */
|
||||
bool m_relay_txs GUARDED_BY(m_bloom_filter_mutex){false};
|
||||
/** A bloom filter for which transactions to announce to the peer. See BIP37. */
|
||||
std::unique_ptr<CBloomFilter> m_bloom_filter PT_GUARDED_BY(m_bloom_filter_mutex) GUARDED_BY(m_bloom_filter_mutex){nullptr};
|
||||
@@ -3247,10 +3242,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
}
|
||||
peer->m_starting_height = starting_height;
|
||||
|
||||
// We only initialize the m_tx_relay data structure if:
|
||||
// - this isn't an outbound block-relay-only connection; and
|
||||
// - fRelay=true or we're offering NODE_BLOOM to this peer
|
||||
// (NODE_BLOOM means that the peer may turn on tx relay later)
|
||||
// We only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// - this isn't an outbound block-relay-only connection, and
|
||||
// - fRelay=true (the peer wishes to receive transaction announcements)
|
||||
// or we're offering NODE_BLOOM to this peer. NODE_BLOOM means that
|
||||
// the peer may turn on transaction relay later.
|
||||
if (!pfrom.IsBlockOnlyConn() &&
|
||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||
auto* const tx_relay = peer->SetTxRelay();
|
||||
|
||||
Reference in New Issue
Block a user