From faa404e119c54526077b056f6f380782e64986c4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 30 Jan 2026 11:18:17 +0100 Subject: [PATCH] test: Add is_connected_to helper Needed in the next commit. Co-Authored-By: David Gumberg --- test/functional/test_framework/test_node.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 541c758b5ec..0cd6dd1e840 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -914,6 +914,11 @@ class TestNode(): self.wait_until(lambda: self.num_test_p2p_connections() == 0) + def is_connected_to(self, other): + assert isinstance(other, TestNode) + other_subver = other.getnetworkinfo()["subversion"] + return any(peer["subver"] == other_subver for peer in self.getpeerinfo()) + def bumpmocktime(self, seconds): """Fast forward using setmocktime to self.mocktime + seconds. Requires setmocktime to have been called at some point in the past."""