Merge #15897: QA/mininode: Send all headers upfront in send_blocks_and_test to avoid sending an unconnected one
9f9db39041
QA/mininode: Send all headers upfront in send_blocks_and_test to avoid sending an unconnected one (Luke Dashjr)
Pull request description:
While this doesn't currently trigger any problems, the network protocol does expect headers to be sent connectable in normal circumstances, and if too many are sent out of order will disconnect the peer.
ACKs for commit 9f9db3:
Tree-SHA512: 25b88718e4ba3d31aed2de7ece23fab9a0737fd6536c5e618ea8eb5a3a217dab0dffaebc4892df7993bcea7efb7c4fb5085fabebe99535b8f7fdde3c19df54ff
This commit is contained in:
commit
ce6762030f
1 changed files with 1 additions and 1 deletions
|
@ -531,7 +531,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…
Reference in a new issue