mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-19 05:45:05 +01:00
test: p2p: check that getaddr
msgs are only responded once per connection
This commit is contained in:
parent
6f03c45f6b
commit
668aa6af8d
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user