QA/mininode: Send all headers upfront in send_blocks_and_test to avoid sending an unconnected one

pull/764/head
Luke Dashjr 6 years ago
parent 37f236acc6
commit 9f9db39041

@ -534,7 +534,7 @@ class P2PDataStore(P2PInterface):
for b in blocks: for b in blocks:
self.send_message(msg_block(block=b)) self.send_message(msg_block(block=b))
else: else:
self.send_message(msg_headers([CBlockHeader(blocks[-1])])) self.send_message(msg_headers([CBlockHeader(block) for block in blocks]))
wait_until(lambda: blocks[-1].sha256 in self.getdata_requests, timeout=timeout, lock=mininode_lock) wait_until(lambda: blocks[-1].sha256 in self.getdata_requests, timeout=timeout, lock=mininode_lock)
if expect_disconnect: if expect_disconnect:

Loading…
Cancel
Save