File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,10 @@ def setup_rand_addr_msg(self, num):
121121
122122 def send_addr_msg (self , source , msg , receivers ):
123123 source .send_and_ping (msg )
124- # pop m_next_addr_send timer
124+ # invoke m_next_addr_send timer:
125+ # `addr` messages are sent on an exponential distribution with mean interval of 30s.
126+ # Setting the mocktime 600s forward gives a probability of (1 - e^-(600/30)) that
127+ # the event will occur (i.e. this fails once in ~500 million repeats).
125128 self .mocktime += 10 * 60
126129 self .nodes [0 ].setmocktime (self .mocktime )
127130 for peer in receivers :
@@ -282,7 +285,8 @@ def getaddr_tests(self):
282285 block_relay_peer .send_and_ping (msg_getaddr ())
283286 inbound_peer .send_and_ping (msg_getaddr ())
284287
285- self .mocktime += 5 * 60
288+ # invoke m_next_addr_send timer, see under send_addr_msg() function for rationale
289+ self .mocktime += 10 * 60
286290 self .nodes [0 ].setmocktime (self .mocktime )
287291 inbound_peer .wait_until (lambda : inbound_peer .addr_received () is True )
288292
You can’t perform that action at this time.
0 commit comments