@@ -371,21 +371,6 @@ def sync_all(self, node_groups=None):
371371 sync_blocks (group )
372372 sync_mempools (group )
373373
374- def enable_mocktime (self ):
375- """Enable mocktime for the script.
376-
377- mocktime may be needed for scripts that use the cached version of the
378- blockchain. If the cached version of the blockchain is used without
379- mocktime then the mempools will not sync due to IBD.
380-
381- For backward compatibility of the python scripts with previous
382- versions of the cache, this helper function sets mocktime to Jan 1,
383- 2014 + (201 * 10 * 60)"""
384- self .mocktime = 1388534400 + (201 * 10 * 60 )
385-
386- def disable_mocktime (self ):
387- self .mocktime = 0
388-
389374 # Private helper methods. These should not be accessed by the subclass test scripts.
390375
391376 def _start_logging (self ):
@@ -451,14 +436,18 @@ def _initialize_chain(self):
451436 for node in self .nodes :
452437 node .wait_for_rpc_connection ()
453438
439+ # For backward compatibility of the python scripts with previous
440+ # versions of the cache, set mocktime to Jan 1,
441+ # 2014 + (201 * 10 * 60)"""
442+ self .mocktime = 1388534400 + (201 * 10 * 60 )
443+
454444 # Create a 200-block-long chain; each of the 4 first nodes
455445 # gets 25 mature blocks and 25 immature.
456446 # Note: To preserve compatibility with older versions of
457447 # initialize_chain, only 4 nodes will generate coins.
458448 #
459449 # blocks are created with timestamps 10 minutes apart
460450 # starting from 2010 minutes in the past
461- self .enable_mocktime ()
462451 block_time = self .mocktime - (201 * 10 * 60 )
463452 for i in range (2 ):
464453 for peer in range (4 ):
@@ -472,7 +461,7 @@ def _initialize_chain(self):
472461 # Shut them down, and clean up cache directories:
473462 self .stop_nodes ()
474463 self .nodes = []
475- self .disable_mocktime ()
464+ self .mocktime = 0
476465
477466 def cache_path (n , * paths ):
478467 return os .path .join (get_datadir_path (self .options .cachedir , n ), "regtest" , * paths )
0 commit comments