aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/functional/p2p_addr_relay.py10
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):