Skip to content

Commit 44adf68

Browse files
author
MarcoFalke
committed
Merge #9159: [qa] Wait for specific block announcement in p2p-compactblocks
dfa44d1 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
2 parents ce612f1 + dfa44d1 commit 44adf68

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

qa/rpc-tests/p2p-compactblocks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,15 @@ def received_sendcmpct():
186186

187187
def check_announcement_of_new_block(node, peer, predicate):
188188
peer.clear_block_announcement()
189-
node.generate(1)
190-
got_message = wait_until(lambda: peer.block_announced, timeout=30)
189+
block_hash = int(node.generate(1)[0], 16)
190+
peer.wait_for_block_announcement(block_hash, timeout=30)
191191
assert(peer.block_announced)
192192
assert(got_message)
193+
193194
with mininode_lock:
194-
assert(predicate(peer))
195+
assert predicate(peer), (
196+
"block_hash={!r}, cmpctblock={!r}, inv={!r}".format(
197+
block_hash, peer.last_cmpctblock, peer.last_inv))
195198

196199
# We shouldn't get any block announcements via cmpctblock yet.
197200
check_announcement_of_new_block(node, test_node, lambda p: p.last_cmpctblock is None)

0 commit comments

Comments
 (0)