Skip to content

Commit 9cfc1c9

Browse files
test: check that we don't send a getaddr msg to an inbound peer
Co-authored-by: pablomartin4btc <[email protected]>
1 parent 88c33c6 commit 9cfc1c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/p2p_addr_relay.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,16 @@ def getaddr_tests(self):
270270
full_outbound_peer.sync_with_ping()
271271
assert full_outbound_peer.getaddr_received()
272272

273-
self.log.info('Check that we do not send a getaddr message upon connecting to a block-relay-only peer')
273+
self.log.info('Check that we do not send a getaddr message to a block-relay-only or inbound peer')
274274
block_relay_peer = self.nodes[0].add_outbound_p2p_connection(AddrReceiver(), p2p_idx=1, connection_type="block-relay-only")
275275
block_relay_peer.sync_with_ping()
276276
assert_equal(block_relay_peer.getaddr_received(), False)
277277

278-
self.log.info('Check that we answer getaddr messages only from inbound peers')
279278
inbound_peer = self.nodes[0].add_p2p_connection(AddrReceiver(send_getaddr=False))
280279
inbound_peer.sync_with_ping()
280+
assert_equal(inbound_peer.getaddr_received(), False)
281281

282+
self.log.info('Check that we answer getaddr messages only from inbound peers')
282283
# Add some addresses to addrman
283284
for i in range(1000):
284285
first_octet = i >> 8

0 commit comments

Comments
 (0)