aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/sendheaders.py
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-10-03 18:30:52 -0400
committerMatt Corallo <git@bluematt.me>2016-11-07 17:38:22 -0500
commit3451203b5c67c234d168a409d69ff9623573dae3 (patch)
treeafb4b1995469db781d2e22e61b38a10912e46b24 /qa/rpc-tests/sendheaders.py
parentd768f151f63eb3bb505676bca07be24da151f6b2 (diff)
[qa] Respond to getheaders and do not assume a getdata on inv
Diffstat (limited to 'qa/rpc-tests/sendheaders.py')
-rwxr-xr-xqa/rpc-tests/sendheaders.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/qa/rpc-tests/sendheaders.py b/qa/rpc-tests/sendheaders.py
index 81b2442e6a..37b98c576e 100755
--- a/qa/rpc-tests/sendheaders.py
+++ b/qa/rpc-tests/sendheaders.py
@@ -348,14 +348,13 @@ class SendHeadersTest(BitcoinTestFramework):
if j == 0:
# Announce via inv
test_node.send_block_inv(tip)
- test_node.wait_for_getdata([tip], timeout=5)
+ test_node.wait_for_getheaders(timeout=5)
+ # Should have received a getheaders now
+ test_node.send_header_for_blocks(blocks)
# Test that duplicate inv's won't result in duplicate
# getdata requests, or duplicate headers announcements
- inv_node.send_block_inv(tip)
- # Should have received a getheaders as well!
- test_node.send_header_for_blocks(blocks)
- test_node.wait_for_getdata([x.sha256 for x in blocks[0:-1]], timeout=5)
- [ inv_node.send_block_inv(x.sha256) for x in blocks[0:-1] ]
+ [ inv_node.send_block_inv(x.sha256) for x in blocks ]
+ test_node.wait_for_getdata([x.sha256 for x in blocks], timeout=5)
inv_node.sync_with_ping()
else:
# Announce via headers