Skip to content

Commit 8a20f76

Browse files
committed
test: drop duplicate getaddrs from p2p_getaddr_caching
python p2p instances will automatically send a getaddr msg after connecting, the explicit message was a duplicate that was being ignored.
1 parent feb0096 commit 8a20f76

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/functional/p2p_getaddr_caching.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import time
88

9-
from test_framework.messages import msg_getaddr
109
from test_framework.p2p import (
1110
P2PInterface,
1211
p2p_lock
@@ -21,6 +20,7 @@
2120
MAX_ADDR_TO_SEND = 1000
2221
MAX_PCT_ADDR_TO_SEND = 23
2322

23+
2424
class AddrReceiver(P2PInterface):
2525

2626
def __init__(self):
@@ -70,11 +70,8 @@ def run_test(self):
7070
cur_mock_time = int(time.time())
7171
for i in range(N):
7272
addr_receiver_local = self.nodes[0].add_p2p_connection(AddrReceiver())
73-
addr_receiver_local.send_and_ping(msg_getaddr())
7473
addr_receiver_onion1 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port1)
75-
addr_receiver_onion1.send_and_ping(msg_getaddr())
7674
addr_receiver_onion2 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port2)
77-
addr_receiver_onion2.send_and_ping(msg_getaddr())
7875

7976
# Trigger response
8077
cur_mock_time += 5 * 60
@@ -105,11 +102,8 @@ def run_test(self):
105102

106103
self.log.info('After time passed, see a new response to addr request')
107104
addr_receiver_local = self.nodes[0].add_p2p_connection(AddrReceiver())
108-
addr_receiver_local.send_and_ping(msg_getaddr())
109105
addr_receiver_onion1 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port1)
110-
addr_receiver_onion1.send_and_ping(msg_getaddr())
111106
addr_receiver_onion2 = self.nodes[0].add_p2p_connection(AddrReceiver(), dstport=self.onion_port2)
112-
addr_receiver_onion2.send_and_ping(msg_getaddr())
113107

114108
# Trigger response
115109
cur_mock_time += 5 * 60
@@ -123,5 +117,6 @@ def run_test(self):
123117
assert set(last_response_on_onion_bind1) != set(addr_receiver_onion1.get_received_addrs())
124118
assert set(last_response_on_onion_bind2) != set(addr_receiver_onion2.get_received_addrs())
125119

120+
126121
if __name__ == '__main__':
127122
AddrTest().main()

0 commit comments

Comments
 (0)