@@ -118,9 +118,8 @@ def setup_nodes(self):
118118
119119 def create_big_chain (self ):
120120 # Start by creating some coinbases we can spend later
121- self .generate (self .nodes [1 ], 200 )
122- self .sync_blocks (self .nodes [0 :2 ])
123- self .generate (self .nodes [0 ], 150 )
121+ self .generate (self .nodes [1 ], 200 , sync_fun = lambda : self .sync_blocks (self .nodes [0 :2 ]))
122+ self .generate (self .nodes [0 ], 150 , sync_fun = self .no_op )
124123
125124 # Then mine enough full blocks to create more than 550MiB of data
126125 mine_large_blocks (self .nodes [0 ], 645 )
@@ -211,7 +210,7 @@ def reorg_test(self):
211210 self .disconnect_nodes (1 , 2 )
212211
213212 self .log .info ("Generating new longer chain of 300 more blocks" )
214- self .generate (self .nodes [1 ], 300 )
213+ self .generate (self .nodes [1 ], 300 , sync_fun = self . no_op )
215214
216215 self .log .info ("Reconnect nodes" )
217216 self .connect_nodes (0 , 1 )
@@ -263,7 +262,7 @@ def reorg_back(self):
263262 self .nodes [0 ].invalidateblock (curchainhash )
264263 assert_equal (self .nodes [0 ].getblockcount (), self .mainchainheight )
265264 assert_equal (self .nodes [0 ].getbestblockhash (), self .mainchainhash2 )
266- goalbesthash = self .generate (self .nodes [0 ], blocks_to_mine )[- 1 ]
265+ goalbesthash = self .generate (self .nodes [0 ], blocks_to_mine , sync_fun = self . no_op )[- 1 ]
267266 goalbestheight = first_reorg_height + 1
268267
269268 self .log .info ("Verify node 2 reorged back to the main chain, some blocks of which it had to redownload" )
@@ -306,7 +305,7 @@ def has_block(index):
306305 assert_equal (block1_details ["nTx" ], len (block1_details ["tx" ]))
307306
308307 # mine 6 blocks so we are at height 1001 (i.e., above PruneAfterHeight)
309- self .generate (node , 6 )
308+ self .generate (node , 6 , sync_fun = self . no_op )
310309 assert_equal (node .getblockchaininfo ()["blocks" ], 1001 )
311310
312311 # Pruned block should still know the number of transactions
@@ -337,7 +336,7 @@ def has_block(index):
337336 assert has_block (2 ), "blk00002.dat is still there, should be pruned by now"
338337
339338 # advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat)
340- self .generate (node , 288 )
339+ self .generate (node , 288 , sync_fun = self . no_op )
341340 prune (1000 )
342341 assert not has_block (2 ), "blk00002.dat is still there, should be pruned by now"
343342 assert not has_block (3 ), "blk00003.dat is still there, should be pruned by now"
0 commit comments