Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3748,7 +3748,7 @@ void PeerManagerImpl::ProcessMessage(Peer& peer, CNode& pfrom, const std::string

// Attempt to initialize address relay for outbound peers and use result
// to decide whether to send GETADDR, so that we don't send it to
// inbound or outbound block-relay-only peers.
// inbound, feelers, or outbound block-relay-only peers.
bool send_getaddr{false};
if (!pfrom.IsInboundConn()) {
send_getaddr = SetupAddressRelay(pfrom, peer);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We drop out of SetupAddressRelay for blocks-only nodes rather than gating calls to it. Maybe we should do feelers there too?

Expand Down Expand Up @@ -5612,6 +5612,12 @@ bool PeerManagerImpl::SetupAddressRelay(const CNode& node, Peer& peer)
// information of addr traffic to infer the link.
if (node.IsBlockOnlyConn()) return false;

// We don't participate in addr relay with feeler connections because
// they are short-lived connections made for test-before-evict or to
// promote addresses from addrman's new table to the tried table, and
// are disconnected shortly after the handshake completes.
if (node.IsFeelerConn()) return false;

if (!peer.m_addr_relay_enabled.exchange(true)) {
// During version message processing (non-block-relay-only outbound peers)
// or on first addr-related message we have received (inbound peers), initialize
Expand Down
2 changes: 2 additions & 0 deletions test/functional/p2p_add_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def run_test(self):
assert_equal(feeler_conn.message_count["version"], 1)
# Feeler connections do not request tx relay
assert_equal(feeler_conn.last_message["version"].relay, 0)
# We don't send a GETADDR to feelers
assert_equal(feeler_conn.message_count["getaddr"], 0)

self.log.info("Send version message early to node")
# Normally the test framework would be shy and send the version message
Expand Down
Loading