Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/mininode.py
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | def __init__(self): | ||||
# Should only call methods on this from the NetworkThread, c.f. | # Should only call methods on this from the NetworkThread, c.f. | ||||
# call_soon_threadsafe | # call_soon_threadsafe | ||||
self._transport = None | self._transport = None | ||||
@property | @property | ||||
def is_connected(self): | def is_connected(self): | ||||
return self._transport is not None | return self._transport is not None | ||||
def peer_connect(self, dstaddr, dstport, net="regtest"): | def peer_connect(self, dstaddr, dstport, *, net): | ||||
assert not self.is_connected | assert not self.is_connected | ||||
self.dstaddr = dstaddr | self.dstaddr = dstaddr | ||||
self.dstport = dstport | self.dstport = dstport | ||||
# The initial message to send after the connection was made: | # The initial message to send after the connection was made: | ||||
self.on_connection_send_msg = None | self.on_connection_send_msg = None | ||||
self.on_connection_send_msg_is_raw = False | self.on_connection_send_msg_is_raw = False | ||||
self.recvbuf = b"" | self.recvbuf = b"" | ||||
self.magic_bytes = MAGIC_BYTES[net] | self.magic_bytes = MAGIC_BYTES[net] | ||||
▲ Show 20 Lines • Show All 537 Lines • Show Last 20 Lines |