mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #8872: Remove block-request logic from INV message processing
037159cRemove block-request logic from INV message processing (Matt Corallo)3451203[qa] Respond to getheaders and do not assume a getdata on inv (Matt Corallo)d768f15[qa] Make comptool push blocks instead of relying on inv-fetch (mrbandrews)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -396,6 +400,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)
|
||||
|
||||
Reference in New Issue
Block a user