@@ -140,7 +140,7 @@ def relay_tests(self):
140
140
141
141
self .log .info ('Check relay of addresses received from outbound peers' )
142
142
inbound_peer = self .nodes [0 ].add_p2p_connection (AddrReceiver (test_addr_contents = True ))
143
- full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (GetAddrStore (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
143
+ full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (AddrReceiver (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
144
144
msg = self .setup_addr_msg (2 )
145
145
self .send_addr_msg (full_outbound_peer , msg , [inbound_peer ])
146
146
self .log .info ('Check that the first addr message received from an outbound peer is not relayed' )
@@ -156,7 +156,7 @@ def relay_tests(self):
156
156
assert_equal (inbound_peer .num_ipv4_received , 2 )
157
157
158
158
self .log .info ('Check address relay to outbound peers' )
159
- block_relay_peer = self .nodes [0 ].add_outbound_p2p_connection (GetAddrStore (), p2p_idx = 1 , connection_type = "block-relay-only" )
159
+ block_relay_peer = self .nodes [0 ].add_outbound_p2p_connection (AddrReceiver (), p2p_idx = 1 , connection_type = "block-relay-only" )
160
160
msg3 = self .setup_addr_msg (2 )
161
161
self .send_addr_msg (inbound_peer , msg3 , [full_outbound_peer , block_relay_peer ])
162
162
@@ -170,17 +170,17 @@ def relay_tests(self):
170
170
def getaddr_tests (self ):
171
171
self .log .info ('Test getaddr behavior' )
172
172
self .log .info ('Check that we send a getaddr message upon connecting to an outbound-full-relay peer' )
173
- full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (GetAddrStore (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
173
+ full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (AddrReceiver (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
174
174
full_outbound_peer .sync_with_ping ()
175
- assert full_outbound_peer .getaddr_received
175
+ assert full_outbound_peer .getaddr_received ()
176
176
177
177
self .log .info ('Check that we do not send a getaddr message upon connecting to a block-relay-only peer' )
178
- block_relay_peer = self .nodes [0 ].add_outbound_p2p_connection (GetAddrStore (), p2p_idx = 1 , connection_type = "block-relay-only" )
178
+ block_relay_peer = self .nodes [0 ].add_outbound_p2p_connection (AddrReceiver (), p2p_idx = 1 , connection_type = "block-relay-only" )
179
179
block_relay_peer .sync_with_ping ()
180
- assert_equal (block_relay_peer .getaddr_received , False )
180
+ assert_equal (block_relay_peer .getaddr_received () , False )
181
181
182
182
self .log .info ('Check that we answer getaddr messages only from inbound peers' )
183
- inbound_peer = self .nodes [0 ].add_p2p_connection (GetAddrStore ())
183
+ inbound_peer = self .nodes [0 ].add_p2p_connection (AddrReceiver ())
184
184
inbound_peer .sync_with_ping ()
185
185
186
186
# Add some addresses to addrman
@@ -196,7 +196,7 @@ def getaddr_tests(self):
196
196
197
197
self .mocktime += 5 * 60
198
198
self .nodes [0 ].setmocktime (self .mocktime )
199
- inbound_peer .wait_until (inbound_peer .addr_received )
199
+ inbound_peer .wait_until (lambda : inbound_peer .addr_received () is True )
200
200
201
201
assert_equal (full_outbound_peer .num_ipv4_received , 0 )
202
202
assert_equal (block_relay_peer .num_ipv4_received , 0 )
@@ -210,9 +210,9 @@ def blocksonly_mode_tests(self):
210
210
self .mocktime = int (time .time ())
211
211
212
212
self .log .info ('Check that we send getaddr messages' )
213
- full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (GetAddrStore (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
213
+ full_outbound_peer = self .nodes [0 ].add_outbound_p2p_connection (AddrReceiver (), p2p_idx = 0 , connection_type = "outbound-full-relay" )
214
214
full_outbound_peer .sync_with_ping ()
215
- assert full_outbound_peer .getaddr_received
215
+ assert full_outbound_peer .getaddr_received ()
216
216
217
217
self .log .info ('Check that we relay address messages' )
218
218
addr_source = self .nodes [0 ].add_p2p_connection (P2PInterface ())
0 commit comments