diff options
author | Matt Corallo <git@bluematt.me> | 2016-10-03 18:30:52 -0400 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2016-11-07 17:38:22 -0500 |
commit | 3451203b5c67c234d168a409d69ff9623573dae3 (patch) | |
tree | afb4b1995469db781d2e22e61b38a10912e46b24 /qa/rpc-tests/p2p-compactblocks.py | |
parent | d768f151f63eb3bb505676bca07be24da151f6b2 (diff) | |
download | bitcoin-3451203b5c67c234d168a409d69ff9623573dae3.tar.xz |
[qa] Respond to getheaders and do not assume a getdata on inv
Diffstat (limited to 'qa/rpc-tests/p2p-compactblocks.py')
-rwxr-xr-x | qa/rpc-tests/p2p-compactblocks.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qa/rpc-tests/p2p-compactblocks.py b/qa/rpc-tests/p2p-compactblocks.py index 6b5d477131..722ec0f62e 100755 --- a/qa/rpc-tests/p2p-compactblocks.py +++ b/qa/rpc-tests/p2p-compactblocks.py @@ -27,6 +27,7 @@ class TestNode(SingleNodeConnCB): self.last_cmpctblock = None self.block_announced = False self.last_getdata = None + self.last_getheaders = None self.last_getblocktxn = None self.last_block = None self.last_blocktxn = None @@ -64,6 +65,9 @@ class TestNode(SingleNodeConnCB): def on_getdata(self, conn, message): self.last_getdata = message + def on_getheaders(self, conn, message): + self.last_getheaders = message + def on_getblocktxn(self, conn, message): self.last_getblocktxn = message @@ -393,6 +397,9 @@ class CompactBlocksTest(BitcoinTestFramework): if announce == "inv": test_node.send_message(msg_inv([CInv(2, block.sha256)])) + success = wait_until(lambda: test_node.last_getheaders is not None, timeout=30) + assert(success) + test_node.send_header_for_blocks([block]) else: test_node.send_header_for_blocks([block]) success = wait_until(lambda: test_node.last_getdata is not None, timeout=30) |