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):
121
121
122
122
def send_addr_msg (self , source , msg , receivers ):
123
123
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).
125
128
self .mocktime += 10 * 60
126
129
self .nodes [0 ].setmocktime (self .mocktime )
127
130
for peer in receivers :
@@ -282,7 +285,8 @@ def getaddr_tests(self):
282
285
block_relay_peer .send_and_ping (msg_getaddr ())
283
286
inbound_peer .send_and_ping (msg_getaddr ())
284
287
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
286
290
self .nodes [0 ].setmocktime (self .mocktime )
287
291
inbound_peer .wait_until (lambda : inbound_peer .addr_received () is True )
288
292
You can’t perform that action at this time.
0 commit comments