mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 10:12:28 +02:00
test: Add is_connected_to helper
Needed in the next commit.
Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>
Github-Pull: #34425
Rebased-From: faa404e119
This commit is contained in:
@@ -920,6 +920,11 @@ class TestNode():
|
|||||||
|
|
||||||
self.wait_until(lambda: self.num_test_p2p_connections() == 0)
|
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):
|
def bumpmocktime(self, seconds):
|
||||||
"""Fast forward using setmocktime to self.mocktime + seconds. Requires setmocktime to have
|
"""Fast forward using setmocktime to self.mocktime + seconds. Requires setmocktime to have
|
||||||
been called at some point in the past."""
|
been called at some point in the past."""
|
||||||
|
|||||||
Reference in New Issue
Block a user