mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
test: don't attempt to (dis)connect nodes to/from themselves
This commit is contained in:
parent
c200175ebf
commit
4a0fc8b69e
@ -54,7 +54,6 @@ class DIP3V19Test(DashTestFramework):
|
||||
null_hash = format(0, "064x")
|
||||
|
||||
for i in range(len(self.nodes)):
|
||||
if i != 0:
|
||||
self.connect_nodes(i, 0)
|
||||
|
||||
self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0)
|
||||
|
@ -23,12 +23,10 @@ class LLMQChainLocksTest(DashTestFramework):
|
||||
self.set_dash_test_params(5, 4, fast_dip3_enforcement=True)
|
||||
|
||||
def run_test(self):
|
||||
|
||||
# Connect all nodes to node1 so that we always have the whole network connected
|
||||
# Otherwise only masternode connections will be established between nodes, which won't propagate TXs/blocks
|
||||
# Usually node0 is the one that does this, but in this test we isolate it multiple times
|
||||
for i in range(len(self.nodes)):
|
||||
if i != 1:
|
||||
self.connect_nodes(i, 1)
|
||||
|
||||
self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False)
|
||||
|
@ -58,7 +58,6 @@ class LLMQEvoNodesTest(DashTestFramework):
|
||||
null_hash = format(0, "064x")
|
||||
|
||||
for i in range(len(self.nodes)):
|
||||
if i != 0:
|
||||
self.connect_nodes(i, 0)
|
||||
|
||||
self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0)
|
||||
|
@ -65,7 +65,6 @@ class LLMQQuorumRotationTest(DashTestFramework):
|
||||
# Usually node0 is the one that does this, but in this test we isolate it multiple times
|
||||
|
||||
for i in range(len(self.nodes)):
|
||||
if i != 1:
|
||||
self.connect_nodes(i, 0)
|
||||
|
||||
self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0)
|
||||
|
@ -692,6 +692,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
self.nodes[i].process.wait(timeout)
|
||||
|
||||
def connect_nodes(self, a, b):
|
||||
# A node cannot connect to itself, bail out early
|
||||
if (a == b):
|
||||
return
|
||||
|
||||
def connect_nodes_helper(from_connection, node_num):
|
||||
ip_port = "127.0.0.1:" + str(p2p_port(node_num))
|
||||
from_connection.addnode(ip_port, "onetry")
|
||||
@ -706,6 +710,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
connect_nodes_helper(self.nodes[a], b)
|
||||
|
||||
def disconnect_nodes(self, a, b):
|
||||
# A node cannot disconnect from itself, bail out early
|
||||
if (a == b):
|
||||
return
|
||||
|
||||
def disconnect_nodes_helper(from_connection, node_num):
|
||||
def get_peer_ids():
|
||||
result = []
|
||||
|
Loading…
Reference in New Issue
Block a user