@@ -371,21 +371,6 @@ def sync_all(self, node_groups=None):
371
371
sync_blocks (group )
372
372
sync_mempools (group )
373
373
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
-
389
374
# Private helper methods. These should not be accessed by the subclass test scripts.
390
375
391
376
def _start_logging (self ):
@@ -451,14 +436,18 @@ def _initialize_chain(self):
451
436
for node in self .nodes :
452
437
node .wait_for_rpc_connection ()
453
438
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
+
454
444
# Create a 200-block-long chain; each of the 4 first nodes
455
445
# gets 25 mature blocks and 25 immature.
456
446
# Note: To preserve compatibility with older versions of
457
447
# initialize_chain, only 4 nodes will generate coins.
458
448
#
459
449
# blocks are created with timestamps 10 minutes apart
460
450
# starting from 2010 minutes in the past
461
- self .enable_mocktime ()
462
451
block_time = self .mocktime - (201 * 10 * 60 )
463
452
for i in range (2 ):
464
453
for peer in range (4 ):
@@ -472,7 +461,7 @@ def _initialize_chain(self):
472
461
# Shut them down, and clean up cache directories:
473
462
self .stop_nodes ()
474
463
self .nodes = []
475
- self .disable_mocktime ()
464
+ self .mocktime = 0
476
465
477
466
def cache_path (n , * paths ):
478
467
return os .path .join (get_datadir_path (self .options .cachedir , n ), "regtest" , * paths )
0 commit comments