diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/p2p_addr_relay.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/p2p_addr_relay.py b/test/functional/p2p_addr_relay.py index 5532056dbe..e55febc69a 100755 --- a/test/functional/p2p_addr_relay.py +++ b/test/functional/p2p_addr_relay.py @@ -121,7 +121,10 @@ class AddrTest(BitcoinTestFramework): def send_addr_msg(self, source, msg, receivers): source.send_and_ping(msg) - # pop m_next_addr_send timer + # invoke m_next_addr_send timer: + # `addr` messages are sent on an exponential distribution with mean interval of 30s. + # Setting the mocktime 600s forward gives a probability of (1 - e^-(600/30)) that + # the event will occur (i.e. this fails once in ~500 million repeats). self.mocktime += 10 * 60 self.nodes[0].setmocktime(self.mocktime) for peer in receivers: @@ -282,7 +285,8 @@ class AddrTest(BitcoinTestFramework): block_relay_peer.send_and_ping(msg_getaddr()) inbound_peer.send_and_ping(msg_getaddr()) - self.mocktime += 5 * 60 + # invoke m_next_addr_send timer, see under send_addr_msg() function for rationale + self.mocktime += 10 * 60 self.nodes[0].setmocktime(self.mocktime) inbound_peer.wait_until(lambda: inbound_peer.addr_received() is True) |