@@ -101,13 +101,11 @@ def run_test(self):
101
101
102
102
# Check that getdata request for stale block succeeds
103
103
self .send_block_request (stale_hash , node0 )
104
- test_function = lambda : self .last_block_equals (stale_hash , node0 )
105
- self .wait_until (test_function , timeout = 3 )
104
+ node0 .wait_for_block (stale_hash , timeout = 3 )
106
105
107
106
# Check that getheader request for stale block header succeeds
108
107
self .send_header_request (stale_hash , node0 )
109
- test_function = lambda : self .last_header_equals (stale_hash , node0 )
110
- self .wait_until (test_function , timeout = 3 )
108
+ node0 .wait_for_header (hex (stale_hash ), timeout = 3 )
111
109
112
110
# Longest chain is extended so stale is much older than chain tip
113
111
self .nodes [0 ].setmocktime (0 )
@@ -137,12 +135,10 @@ def run_test(self):
137
135
node0 .sync_with_ping ()
138
136
139
137
self .send_block_request (block_hash , node0 )
140
- test_function = lambda : self .last_block_equals (block_hash , node0 )
141
- self .wait_until (test_function , timeout = 3 )
138
+ node0 .wait_for_block (block_hash , timeout = 3 )
142
139
143
140
self .send_header_request (block_hash , node0 )
144
- test_function = lambda : self .last_header_equals (block_hash , node0 )
145
- self .wait_until (test_function , timeout = 3 )
141
+ node0 .wait_for_header (hex (block_hash ), timeout = 3 )
146
142
147
143
if __name__ == '__main__' :
148
144
P2PFingerprintTest ().main ()
0 commit comments