Skip to content

Commit 175a46f

Browse files
committed
test: a simpler way to disable mocktime in p2p_initial_headers_sync.py
1 parent f675fcb commit 175a46f

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

test/functional/p2p_initial_headers_sync.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,9 @@ def set_test_params(self):
3030
self.setup_clean_chain = True
3131
self.num_nodes = 1
3232

33-
def setup_chain(self):
34-
# This test operates under the assumption that the adjusted time is well ahead of block
35-
# time.
36-
#
37-
# By default when we setup a new chain, we also adjust the mocktime (this is not done in
38-
# Bitcoin's test suite), which violates this test's assumption and causes it to fail. We
39-
# remedy this by ensuring the test's assumptions are met (i.e. we don't adjust mocktime)
40-
#
41-
self.log.info("Initializing test directory " + self.options.tmpdir)
42-
if self.setup_clean_chain:
43-
self._initialize_chain_clean()
44-
else:
45-
self._initialize_chain()
33+
def setup_network(self):
34+
self.disable_mocktime()
35+
super().setup_network()
4636

4737
def announce_random_block(self, peers):
4838
new_block_announcement = msg_inv(inv=[CInv(MSG_BLOCK, random.randrange(1<<256))])

0 commit comments

Comments
 (0)