test: Remove unused, confusing and brittle connect_nodes.wait_for_connect

The option is unused since the last removals in:
* 4c40a923f0, and
* 81bf3ebff7

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.
This commit is contained in:
MarcoFalke
2026-03-27 16:21:42 +01:00
parent fab2772647
commit fae807ed25

View File

@@ -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)