mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
net: Avoid SetTxRelay for feeler connections
This commit is contained in:
@@ -395,9 +395,7 @@ struct Peer {
|
||||
private:
|
||||
Mutex m_tx_relay_mutex;
|
||||
|
||||
/** Transaction relay data. Will be a nullptr if we're not relaying
|
||||
* transactions with this peer (e.g. if it's a block-relay-only peer or
|
||||
* the peer has sent us fRelay=false with bloom filters disabled). */
|
||||
/** Transaction relay data. May be a nullptr. */
|
||||
std::unique_ptr<TxRelay> m_tx_relay GUARDED_BY(m_tx_relay_mutex);
|
||||
};
|
||||
|
||||
@@ -3261,12 +3259,14 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
}
|
||||
peer->m_starting_height = starting_height;
|
||||
|
||||
// We only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// Only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// - this isn't an outbound block-relay-only connection, and
|
||||
// - this isn't an outbound feeler 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() &&
|
||||
!pfrom.IsFeelerConn() &&
|
||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||
auto* const tx_relay = peer->SetTxRelay();
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user