mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
[test] Add functionality to AddrReceiver
Add two simple helper functions to `AddrReceiver` to support callers currently using `GetAddrStore` [used in next commit].
This commit is contained in:
parent
09dc073cff
commit
e8c67ea19a
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue