What changed, and why it matters
This commit adds a small helper function to Bitcoin Core's internal test framework. It lets one test node check whether it is connected to another test node by comparing their network version strings. There is no change to the actual Bitcoin Core software that users run, and no security issue is visible in the code.
No security action needed. This is a benign test-framework refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces TestNode.is_connected_to(other) in test/functional/test_framework/test_node.py. It asserts the argument is a TestNode, fetches the other node’s subversion from getnetworkinfo(), and checks whether any peer in self.getpeerinfo() has a matching subver. This is purely test-infrastructure code used by the functional test suite; it does not modify consensus, networking, wallet, or RPC behavior of the daemon.
Changed components
test/functional/test_framework/test_node.pyInspect captured patch +5 / −0
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 541c758b..0cd6dd1e 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."""
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.