From fae807ed25561bab7148c5a0d7bd847314c79d88 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 27 Mar 2026 16:21:42 +0100 Subject: [PATCH] test: Remove unused, confusing and brittle connect_nodes.wait_for_connect The option is unused since the last removals in: * 4c40a923f003420193aa574745f70788bcf35265, and * 81bf3ebff7e7108bbfbf6fe4e122f4e52f278701 It was brittle and lead to intermittent test issues. Generally, it is also confusing, because if a test wanted to connect nodes without checking their connection, it can use `addnode`, like the rpc_setban.py test. So fix all issues by removing it. --- test/functional/test_framework/test_framework.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 229ff893389..256a384f89f 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -549,14 +549,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): def wait_for_node_exit(self, i, timeout): self.nodes[i].process.wait(timeout) - def connect_nodes(self, a, b, *, peer_advertises_v2=None, wait_for_connect: bool = True): - """ - Kwargs: - wait_for_connect: if True, block until the nodes are verified as connected. You might - want to disable this when using -stopatheight with one of the connected nodes, - since there will be a race between the actual connection and performing - the assertions before one node shuts down. - """ + def connect_nodes(self, a, b, *, peer_advertises_v2=None): from_connection = self.nodes[a] to_connection = self.nodes[b] @@ -582,9 +575,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): # compatibility with older clients from_connection.addnode(ip_port, "onetry") - if not wait_for_connect: - return - self.wait_until(lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None) self.wait_until(lambda: find_conn(to_connection, from_connection_subver, inbound=True) is not None)