Skip to content

Commit e8c67ea

Browse files
committed
[test] Add functionality to AddrReceiver
Add two simple helper functions to `AddrReceiver` to support callers currently using `GetAddrStore` [used in next commit].
1 parent 09dc073 commit e8c67ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/p2p_addr_relay.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def on_addr(self, message):
4040
raise AssertionError("Invalid addr.port of {} (8333-8342 expected)".format(addr.port))
4141
assert addr.ip.startswith('123.123.123.')
4242

43+
def addr_received(self):
44+
return self.num_ipv4_received != 0
45+
46+
def getaddr_received(self):
47+
return self.message_count['getaddr'] > 0
48+
4349

4450
class GetAddrStore(P2PInterface):
4551
getaddr_received = False

0 commit comments

Comments
 (0)