diff --git a/test/functional/feature_dip3_v19.py b/test/functional/feature_dip3_v19.py index 6ff2611bbd..41e3ce900b 100755 --- a/test/functional/feature_dip3_v19.py +++ b/test/functional/feature_dip3_v19.py @@ -56,10 +56,6 @@ class DIP3V19Test(DashTestFramework): self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn()) 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) self.wait_for_sporks_same() diff --git a/test/functional/feature_llmq_chainlocks.py b/test/functional/feature_llmq_chainlocks.py index 49563bb46e..cc6f670224 100755 --- a/test/functional/feature_llmq_chainlocks.py +++ b/test/functional/feature_llmq_chainlocks.py @@ -23,13 +23,11 @@ class LLMQChainLocksTest(DashTestFramework): self.set_dash_test_params(5, 4) 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) + for i in range(2, len(self.nodes)): + self.connect_nodes(i, 1) self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False) diff --git a/test/functional/feature_llmq_evo.py b/test/functional/feature_llmq_evo.py index a26f385995..c9a41a7c29 100755 --- a/test/functional/feature_llmq_evo.py +++ b/test/functional/feature_llmq_evo.py @@ -57,10 +57,6 @@ class LLMQEvoNodesTest(DashTestFramework): self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn()) 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) self.nodes[0].sporkupdate("SPORK_2_INSTANTSEND_ENABLED", 1) self.wait_for_sporks_same() diff --git a/test/functional/feature_llmq_rotation.py b/test/functional/feature_llmq_rotation.py index 04ad6bd40b..e2567c7579 100755 --- a/test/functional/feature_llmq_rotation.py +++ b/test/functional/feature_llmq_rotation.py @@ -64,10 +64,6 @@ class LLMQQuorumRotationTest(DashTestFramework): # 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, 0) - self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0) self.wait_for_sporks_same() diff --git a/test/functional/feature_mnehf.py b/test/functional/feature_mnehf.py index 17eab92f15..bf99750c9a 100755 --- a/test/functional/feature_mnehf.py +++ b/test/functional/feature_mnehf.py @@ -43,7 +43,7 @@ class MnehfTest(DashTestFramework): self.stop_node(index) self.start_masternode(mn) for i in range(1, self.num_nodes): - self.connect_nodes(i, 0) + self.connect_nodes(i, 0) def slowly_generate_batch(self, amount): self.log.info(f"Slowly generate {amount} blocks") diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index 9d6c47ce07..1b7c6311bf 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -213,7 +213,6 @@ class NetTest(DashTestFramework): self.log.info('Test extended connections info') # Connect nodes both ways. - self.connect_nodes(0, 1) self.connect_nodes(1, 0) assert_equal(self.nodes[1].getnetworkinfo()['connections'], 2) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index eebc89d266..f0c877d734 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -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 = []