mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-19 05:45:05 +01:00
test: add block sync to getblockfrompeer.py
This fixes an intermittent error, caused by blocks arriving out of order due to how compact block relay may revert to headers processing when the tip hasn't caught up, and resulting in slightly different pruning behavior. Making sure that all blocks from the previous tests are synced before generating more blocks makes this impossible. See Issue #27749 for more details.
This commit is contained in:
parent
71300489af
commit
9fe9074266
@ -117,9 +117,11 @@ class GetBlockFromPeerTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-1, error_msg, self.nodes[1].getblockfrompeer, blockhash, node1_interface_id)
|
||||
|
||||
self.log.info("Connect pruned node")
|
||||
# We need to generate more blocks to be able to prune
|
||||
self.connect_nodes(0, 2)
|
||||
pruned_node = self.nodes[2]
|
||||
self.sync_blocks([self.nodes[0], pruned_node])
|
||||
|
||||
# We need to generate more blocks to be able to prune
|
||||
self.generate(self.nodes[0], 400, sync_fun=self.no_op)
|
||||
self.sync_blocks([self.nodes[0], pruned_node])
|
||||
pruneheight = pruned_node.pruneblockchain(300)
|
||||
|
Loading…
Reference in New Issue
Block a user