@@ -288,6 +288,7 @@ def test_nonnull_locators(self, test_node, inv_node):
288
288
# 1. Mine a block; expect inv announcements each time
289
289
self .log .info ("Part 1: headers don't start before sendheaders message..." )
290
290
for i in range (4 ):
291
+ self .log .debug ("Part 1.{}: starting..." .format (i ))
291
292
old_tip = tip
292
293
tip = self .mine_blocks (1 )
293
294
inv_node .check_last_inv_announcement (inv = [tip ])
@@ -335,11 +336,13 @@ def test_nonnull_locators(self, test_node, inv_node):
335
336
height = self .nodes [0 ].getblockcount () + 1
336
337
block_time += 10 # Advance far enough ahead
337
338
for i in range (10 ):
339
+ self .log .debug ("Part 2.{}: starting..." .format (i ))
338
340
# Mine i blocks, and alternate announcing either via
339
341
# inv (of tip) or via headers. After each, new blocks
340
342
# mined by the node should successfully be announced
341
343
# with block header, even though the blocks are never requested
342
344
for j in range (2 ):
345
+ self .log .debug ("Part 2.{}.{}: starting..." .format (i , j ))
343
346
blocks = []
344
347
for b in range (i + 1 ):
345
348
blocks .append (create_block (tip , create_coinbase (height ), block_time ))
@@ -386,6 +389,7 @@ def test_nonnull_locators(self, test_node, inv_node):
386
389
# PART 3. Headers announcements can stop after large reorg, and resume after
387
390
# getheaders or inv from peer.
388
391
for j in range (2 ):
392
+ self .log .debug ("Part 3.{}: starting..." .format (j ))
389
393
# First try mining a reorg that can propagate with header announcement
390
394
new_block_hashes = self .mine_reorg (length = 7 )
391
395
tip = new_block_hashes [- 1 ]
@@ -412,23 +416,28 @@ def test_nonnull_locators(self, test_node, inv_node):
412
416
test_node .wait_for_block (new_block_hashes [- 1 ])
413
417
414
418
for i in range (3 ):
419
+ self .log .debug ("Part 3.{}.{}: starting..." .format (j , i ))
420
+
415
421
# Mine another block, still should get only an inv
416
422
tip = self .mine_blocks (1 )
417
423
inv_node .check_last_inv_announcement (inv = [tip ])
418
424
test_node .check_last_inv_announcement (inv = [tip ])
419
425
if i == 0 :
420
- self . log . debug ( " Just get the data -- shouldn't cause headers announcements to resume" )
426
+ # Just get the data -- shouldn't cause headers announcements to resume
421
427
test_node .send_get_data ([tip ])
422
428
test_node .wait_for_block (tip )
423
429
elif i == 1 :
424
- self .log .debug ("Send a getheaders message that shouldn't trigger headers announcements to resume (best header sent will be too old)" )
430
+ # Send a getheaders message that shouldn't trigger headers announcements
431
+ # to resume (best header sent will be too old)
425
432
test_node .send_get_headers (locator = [fork_point ], hashstop = new_block_hashes [1 ])
426
433
test_node .send_get_data ([tip ])
427
434
test_node .wait_for_block (tip )
428
435
elif i == 2 :
436
+ # This time, try sending either a getheaders to trigger resumption
437
+ # of headers announcements, or mine a new block and inv it, also
438
+ # triggering resumption of headers announcements.
429
439
test_node .send_get_data ([tip ])
430
440
test_node .wait_for_block (tip )
431
- self .log .debug ("This time, try sending either a getheaders to trigger resumption of headers announcements, or mine a new block and inv it, also triggering resumption of headers announcements." )
432
441
if j == 0 :
433
442
test_node .send_get_headers (locator = [tip ], hashstop = 0 )
434
443
test_node .sync_with_ping ()
@@ -532,6 +541,7 @@ def test_nonnull_locators(self, test_node, inv_node):
532
541
# First we test that receipt of an unconnecting header doesn't prevent
533
542
# chain sync.
534
543
for i in range (10 ):
544
+ self .log .debug ("Part 5.{}: starting..." .format (i ))
535
545
test_node .last_message .pop ("getdata" , None )
536
546
blocks = []
537
547
# Create two more blocks.
0 commit comments