diff options
author | MarcoFalke <falke.marco@gmail.com> | 2016-11-19 23:32:47 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2016-11-19 23:33:29 +0100 |
commit | 44adf683ad232db8ce0cb89b3e236a1f5944cfb0 (patch) | |
tree | 639a77b34bdf6a7795153466fc01c5fa91732070 | |
parent | ce612f17506345527382ec70d6dc398ebe94dbb1 (diff) | |
parent | dfa44d1b07a6d1022005dba63dd6372739eee8a0 (diff) |
Merge #9159: [qa] Wait for specific block announcement in p2p-compactblocks
dfa44d1 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
-rwxr-xr-x | qa/rpc-tests/p2p-compactblocks.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/qa/rpc-tests/p2p-compactblocks.py b/qa/rpc-tests/p2p-compactblocks.py index 1b4c8d90e7..e0b72e6840 100755 --- a/qa/rpc-tests/p2p-compactblocks.py +++ b/qa/rpc-tests/p2p-compactblocks.py @@ -186,12 +186,15 @@ class CompactBlocksTest(BitcoinTestFramework): def check_announcement_of_new_block(node, peer, predicate): peer.clear_block_announcement() - node.generate(1) - got_message = wait_until(lambda: peer.block_announced, timeout=30) + block_hash = int(node.generate(1)[0], 16) + peer.wait_for_block_announcement(block_hash, timeout=30) assert(peer.block_announced) assert(got_message) + with mininode_lock: - assert(predicate(peer)) + assert predicate(peer), ( + "block_hash={!r}, cmpctblock={!r}, inv={!r}".format( + block_hash, peer.last_cmpctblock, peer.last_inv)) # We shouldn't get any block announcements via cmpctblock yet. check_announcement_of_new_block(node, test_node, lambda p: p.last_cmpctblock is None) |