mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-29 23:33:33 +02:00
test: Add is_connected_to helper
Needed in the next commit. Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user