refactor: simplify loop of node connection in test_framework

This commit is contained in:
Konstantin Akimov 2024-11-21 16:58:05 +07:00
parent fa4ba4d169
commit 4ec385d020
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -1511,16 +1511,16 @@ class DashTestFramework(BitcoinTestFramework):
# non-masternodes where disconnected from the control node during prepare_datadirs, # non-masternodes where disconnected from the control node during prepare_datadirs,
# let's reconnect them back to make sure they receive updates # let's reconnect them back to make sure they receive updates
num_simple_nodes = self.num_nodes - self.mn_count - 1 num_simple_nodes = self.num_nodes - self.mn_count
for i in range(0, num_simple_nodes): for i in range(1, num_simple_nodes):
self.connect_nodes(i+1, 0) self.connect_nodes(i, 0)
self.start_masternodes() self.start_masternodes()
self.bump_mocktime(1) self.bump_mocktime(1)
self.generate(self.nodes[0], 1) self.generate(self.nodes[0], 1)
for i in range(0, num_simple_nodes): for i in range(1, num_simple_nodes):
force_finish_mnsync(self.nodes[i + 1]) force_finish_mnsync(self.nodes[i])
# Enable InstantSend (including block filtering) and ChainLocks by default # Enable InstantSend (including block filtering) and ChainLocks by default
self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 0) self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 0)