@@ -294,12 +294,11 @@ def test_compactblock_construction(self, test_node, use_witness_address=True):
294
294
block .rehash ()
295
295
296
296
# Wait until the block was announced (via compact blocks)
297
- wait_until (test_node .received_block_announcement , timeout = 30 , lock = mininode_lock )
297
+ wait_until (lambda : "cmpctblock" in test_node .last_message , timeout = 30 , lock = mininode_lock )
298
298
299
299
# Now fetch and check the compact block
300
300
header_and_shortids = None
301
301
with mininode_lock :
302
- assert "cmpctblock" in test_node .last_message
303
302
# Convert the on-the-wire representation to absolute indexes
304
303
header_and_shortids = HeaderAndShortIDs (test_node .last_message ["cmpctblock" ].header_and_shortids )
305
304
self .check_compactblock_construction_from_block (version , header_and_shortids , block_hash , block )
@@ -309,12 +308,11 @@ def test_compactblock_construction(self, test_node, use_witness_address=True):
309
308
inv = CInv (MSG_CMPCT_BLOCK , block_hash )
310
309
test_node .send_message (msg_getdata ([inv ]))
311
310
312
- wait_until (test_node .received_block_announcement , timeout = 30 , lock = mininode_lock )
311
+ wait_until (lambda : "cmpctblock" in test_node .last_message , timeout = 30 , lock = mininode_lock )
313
312
314
313
# Now fetch and check the compact block
315
314
header_and_shortids = None
316
315
with mininode_lock :
317
- assert "cmpctblock" in test_node .last_message
318
316
# Convert the on-the-wire representation to absolute indexes
319
317
header_and_shortids = HeaderAndShortIDs (test_node .last_message ["cmpctblock" ].header_and_shortids )
320
318
self .check_compactblock_construction_from_block (version , header_and_shortids , block_hash , block )
@@ -691,10 +689,9 @@ def test_end_to_end_block_relay(self, listeners):
691
689
node .submitblock (ToHex (block ))
692
690
693
691
for l in listeners :
694
- wait_until (lambda : l . received_block_announcement () , timeout = 30 , lock = mininode_lock )
692
+ wait_until (lambda : "cmpctblock" in l . last_message , timeout = 30 , lock = mininode_lock )
695
693
with mininode_lock :
696
694
for l in listeners :
697
- assert "cmpctblock" in l .last_message
698
695
l .last_message ["cmpctblock" ].header_and_shortids .header .calc_sha256 ()
699
696
assert_equal (l .last_message ["cmpctblock" ].header_and_shortids .header .sha256 , block .sha256 )
700
697
0 commit comments