Skip to content

Commit

Permalink
test: drop duplicate getaddrs from p2p_getaddr_caching
Browse files Browse the repository at this point in the history
python p2p instances will automatically send a getaddr msg after
connecting, the explicit message was a duplicate that was being ignored.
  • Loading branch information
mzumsande committed Jul 25, 2023
1 parent bb4ceea commit e4d3787
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/functional/p2p_getaddr_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
MAX_ADDR_TO_SEND = 1000
MAX_PCT_ADDR_TO_SEND = 23


class AddrReceiver(P2PInterface):

def __init__(self):
Expand Down Expand Up @@ -70,11 +71,8 @@ def run_test(self):
cur_mock_time = int(time.time())
for i in range(N):
addr_receiver_local = self.nodes[0].add_p2p_connection(AddrReceiver())
addr_receiver_local.send_and_ping(msg_getaddr())
addr_receiver_onion1 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port1)
addr_receiver_onion1.send_and_ping(msg_getaddr())
addr_receiver_onion2 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port2)
addr_receiver_onion2.send_and_ping(msg_getaddr())

# Trigger response
cur_mock_time += 5 * 60
Expand Down Expand Up @@ -123,5 +121,6 @@ def run_test(self):
assert set(last_response_on_onion_bind1) != set(addr_receiver_onion1.get_received_addrs())
assert set(last_response_on_onion_bind2) != set(addr_receiver_onion2.get_received_addrs())


if __name__ == '__main__':
AddrTest().main()

0 comments on commit e4d3787

Please sign in to comment.