Skip to content

Commit eaf6be0

Browse files
committed
[net processing] Do not request transaction relay from feeler connections
Add a test to verify that feeler connections do not request transaction relay.
1 parent 0220b83 commit eaf6be0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ void PeerManagerImpl::PushNodeVersion(CNode& pnode, int64_t nTime)
10961096
CService addr_you = addr.IsRoutable() && !IsProxy(addr) && addr.IsAddrV1Compatible() ? addr : CService();
10971097
uint64_t your_services{addr.nServices};
10981098

1099-
const bool tx_relay = !m_ignore_incoming_txs && pnode.m_tx_relay != nullptr;
1099+
const bool tx_relay = !m_ignore_incoming_txs && pnode.m_tx_relay != nullptr && !pnode.IsFeelerConn();
11001100
m_connman.PushMessage(&pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, my_services, nTime,
11011101
your_services, addr_you, // Together the pre-version-31402 serialization of CAddress "addrYou" (without nTime)
11021102
my_services, CService(), // Together the pre-version-31402 serialization of CAddress "addrMe" (without nTime)

test/functional/p2p_add_connections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def run_test(self):
106106

107107
# Verify version message received
108108
assert_equal(feeler_conn.message_count["version"], 1)
109+
# Feeler connections do not request tx relay
110+
assert_equal(feeler_conn.last_message["version"].relay, 0)
109111

110112
if __name__ == '__main__':
111113
P2PAddConnections().main()

0 commit comments

Comments
 (0)