diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2021-06-15 12:29:46 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2021-06-21 18:05:27 -0700 |
commit | e8c67ea19ac4c0aec4a0b449ac3a4152f80dfff5 (patch) | |
tree | 643c86093d8635c5820285cbd77ac7014ff51380 /test | |
parent | 09dc073cff250afd47a3e219f35d1257add764e9 (diff) | |
download | bitcoin-e8c67ea19ac4c0aec4a0b449ac3a4152f80dfff5.tar.xz |
[test] Add functionality to AddrReceiver
Add two simple helper functions to `AddrReceiver` to support callers currently
using `GetAddrStore` [used in next commit].
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/p2p_addr_relay.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/p2p_addr_relay.py b/test/functional/p2p_addr_relay.py index a033027c71..34c5d71053 100755 --- a/test/functional/p2p_addr_relay.py +++ b/test/functional/p2p_addr_relay.py @@ -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 |