test: use setmnthreadactive to get controlable connect_nodes behaviour

This commit is contained in:
UdjinM6 2024-09-25 13:57:08 +03:00
parent e2ed82a7ae
commit be72ef5592
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9

View File

@ -1083,6 +1083,8 @@ class MasternodeInfo:
self.collateral_vout = collateral_vout self.collateral_vout = collateral_vout
self.addr = addr self.addr = addr
self.evo = evo self.evo = evo
self.node = None
self.nodeIdx = None
class DashTestFramework(BitcoinTestFramework): class DashTestFramework(BitcoinTestFramework):
@ -1097,6 +1099,15 @@ class DashTestFramework(BitcoinTestFramework):
"""Tests must override this method to define test logic""" """Tests must override this method to define test logic"""
raise NotImplementedError raise NotImplementedError
def connect_nodes(self, a, b):
for mn2 in self.mninfo:
if mn2.node is not None:
mn2.node.setmnthreadactive(False)
super().connect_nodes(a, b)
for mn2 in self.mninfo:
if mn2.node is not None:
mn2.node.setmnthreadactive(True)
def set_dash_test_params(self, num_nodes, masterodes_count, extra_args=None, fast_dip3_enforcement=False, evo_count=0): def set_dash_test_params(self, num_nodes, masterodes_count, extra_args=None, fast_dip3_enforcement=False, evo_count=0):
self.mn_count = masterodes_count self.mn_count = masterodes_count
self.evo_count = evo_count self.evo_count = evo_count