[test] Add functionality to AddrReceiver

Add two simple helper functions to `AddrReceiver` to support callers currently
using `GetAddrStore` [used in next commit].
pull/22306/head
Amiti Uttarwar 3 years ago
parent 09dc073cff
commit e8c67ea19a

@ -40,6 +40,12 @@ class AddrReceiver(P2PInterface):
raise AssertionError("Invalid addr.port of {} (8333-8342 expected)".format(addr.port))
assert addr.ip.startswith('123.123.123.')
def addr_received(self):
return self.num_ipv4_received != 0
def getaddr_received(self):
return self.message_count['getaddr'] > 0
class GetAddrStore(P2PInterface):
getaddr_received = False

Loading…
Cancel
Save