File tree 1 file changed +7
-3
lines changed
test/functional/test_framework
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -549,9 +549,13 @@ def _initialize_chain(self):
549
549
cwd = self .options .tmpdir ,
550
550
))
551
551
self .start_node (CACHE_NODE_ID )
552
+ cache_node = self .nodes [CACHE_NODE_ID ]
552
553
553
554
# Wait for RPC connections to be ready
554
- self .nodes [CACHE_NODE_ID ].wait_for_rpc_connection ()
555
+ cache_node .wait_for_rpc_connection ()
556
+
557
+ # Set a time in the past, so that blocks don't end up in the future
558
+ cache_node .setmocktime (cache_node .getblockheader (cache_node .getbestblockhash ())['time' ])
555
559
556
560
# Create a 199-block-long chain; each of the 4 first nodes
557
561
# gets 25 mature blocks and 25 immature.
@@ -560,12 +564,12 @@ def _initialize_chain(self):
560
564
# This is needed so that we are out of IBD when the test starts,
561
565
# see the tip age check in IsInitialBlockDownload().
562
566
for i in range (8 ):
563
- self . nodes [ CACHE_NODE_ID ] .generatetoaddress (
567
+ cache_node .generatetoaddress (
564
568
nblocks = 25 if i != 7 else 24 ,
565
569
address = TestNode .PRIV_KEYS [i % 4 ].address ,
566
570
)
567
571
568
- assert_equal (self . nodes [ CACHE_NODE_ID ] .getblockchaininfo ()["blocks" ], 199 )
572
+ assert_equal (cache_node .getblockchaininfo ()["blocks" ], 199 )
569
573
570
574
# Shut it down, and clean up cache directories:
571
575
self .stop_nodes ()
You can’t perform that action at this time.
0 commit comments