Bug caused the wait_for_block_announcement to be called on the wrong node,
leading to nondeterminism and occasional test failures. Bug was introduced in
merge commit:
d075479 Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py
Underlying commits which conflicted were:
27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py
The first commit changed the test_compactblock_construction function signature
and second commit added code which wasn't updated during the merge to use the
new arguments.
Suhas Daftuar <sdaftuar@chaincode.com> noticed the bug and suggested the fix.
sync_with_ping() only guarantees that the node has processed messages
it's received from the peer, not that block announcements from the node have
made it back to the peer. Replace sync_with_ping() with an explicit check that
the node's tip has been announced.
Python lambda use was incorrect.
sendcmpct messages need to be synchronized with RPC calls to generate().
Headers need to be synced (eg with getheaders) for cmpctblock announcements
to start.
Last test omitted sending a sendcmpct message.