From 668aa6af8d5fbf047d43cf6f85f3335565637fb9 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sun, 3 Sep 2023 14:15:36 +0200 Subject: test: p2p: check that `getaddr` msgs are only responded once per connection --- test/functional/p2p_addr_relay.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/functional/p2p_addr_relay.py') diff --git a/test/functional/p2p_addr_relay.py b/test/functional/p2p_addr_relay.py index e002a520c6..9e093da051 100755 --- a/test/functional/p2p_addr_relay.py +++ b/test/functional/p2p_addr_relay.py @@ -299,6 +299,16 @@ class AddrTest(BitcoinTestFramework): assert_equal(block_relay_peer.num_ipv4_received, 0) assert inbound_peer.num_ipv4_received > 100 + self.log.info('Check that we answer getaddr messages only once per connection') + received_addrs_before = inbound_peer.num_ipv4_received + with self.nodes[0].assert_debug_log(['Ignoring repeated "getaddr".']): + inbound_peer.send_and_ping(msg_getaddr()) + self.mocktime += 10 * 60 + self.nodes[0].setmocktime(self.mocktime) + inbound_peer.sync_with_ping() + received_addrs_after = inbound_peer.num_ipv4_received + assert_equal(received_addrs_before, received_addrs_after) + self.nodes[0].disconnect_p2ps() def blocksonly_mode_tests(self): -- cgit v1.2.3