diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-09-03 14:15:36 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-09-03 14:19:41 +0200 |
commit | 668aa6af8d5fbf047d43cf6f85f3335565637fb9 (patch) | |
tree | 8473440222ac899a6f53019bfdd5f79497e256b9 | |
parent | 6f03c45f6bb5a6edaa3051968b6a1ca4f84d2ccb (diff) |
test: p2p: check that `getaddr` msgs are only responded once per connection
-rwxr-xr-x | test/functional/p2p_addr_relay.py | 10 |
1 files changed, 10 insertions, 0 deletions
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): |