Skip to content

Commit 136d96b

Browse files
committed
test: use wait_for_{block,header} helpers in p2p_fingerprint.py
1 parent 72affcb commit 136d96b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/functional/p2p_fingerprint.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,11 @@ def run_test(self):
101101

102102
# Check that getdata request for stale block succeeds
103103
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)
106105

107106
# Check that getheader request for stale block header succeeds
108107
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)
111109

112110
# Longest chain is extended so stale is much older than chain tip
113111
self.nodes[0].setmocktime(0)
@@ -137,12 +135,10 @@ def run_test(self):
137135
node0.sync_with_ping()
138136

139137
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)
142139

143140
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)
146142

147143
if __name__ == '__main__':
148144
P2PFingerprintTest().main()

0 commit comments

Comments
 (0)