@@ -62,12 +62,11 @@ def run_test(self):
62
62
# Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting
63
63
self .disconnect_nodes (0 , 1 )
64
64
65
- self .nodes [0 ].generate (1 )
66
- self .wait_until (lambda : self .nodes [0 ].getblockcount () == 1000 )
67
- stale_block_hash = self .nodes [0 ].getblockhash (1000 )
65
+ stale_block_hash = self .nodes [0 ].generate (1 )[0 ]
66
+ assert_equal (self .nodes [0 ].getblockcount (), 1000 )
68
67
69
68
self .nodes [1 ].generate (1001 )
70
- self . wait_until ( lambda : self .nodes [1 ].getblockcount () == 2000 )
69
+ assert_equal ( self .nodes [1 ].getblockcount (), 2000 )
71
70
72
71
# Check that nodes have signalled NODE_COMPACT_FILTERS correctly.
73
72
assert peer_0 .nServices & NODE_COMPACT_FILTERS != 0
@@ -164,8 +163,7 @@ def run_test(self):
164
163
start_height = 1 ,
165
164
stop_hash = int (stop_hash , 16 ),
166
165
)
167
- peer_0 .send_message (request )
168
- peer_0 .sync_with_ping ()
166
+ peer_0 .send_and_ping (request )
169
167
response = peer_0 .pop_cfilters ()
170
168
assert_equal (len (response ), 10 )
171
169
@@ -183,8 +181,7 @@ def run_test(self):
183
181
start_height = 1000 ,
184
182
stop_hash = int (stale_block_hash , 16 ),
185
183
)
186
- peer_0 .send_message (request )
187
- peer_0 .sync_with_ping ()
184
+ peer_0 .send_and_ping (request )
188
185
response = peer_0 .pop_cfilters ()
189
186
assert_equal (len (response ), 1 )
190
187
0 commit comments