aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_pruning.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-10 18:02:31 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-10-29 13:34:52 +0200
commitfacc352648e4fe1ed9b406400b6e4a9d51f30349 (patch)
tree7bba05900db761f91c0b416985a3a774984bfd49 /test/functional/feature_pruning.py
parent5574881ce329f91cc5bbc2b9585860a45fde7c3c (diff)
downloadbitcoin-facc352648e4fe1ed9b406400b6e4a9d51f30349.tar.xz
test: Implicitly sync after generate*, unless opted out
Diffstat (limited to 'test/functional/feature_pruning.py')
-rwxr-xr-xtest/functional/feature_pruning.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index c2463d0bcc..125b219bd4 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -118,9 +118,8 @@ class PruneTest(BitcoinTestFramework):
def create_big_chain(self):
# Start by creating some coinbases we can spend later
- self.generate(self.nodes[1], 200)
- self.sync_blocks(self.nodes[0:2])
- self.generate(self.nodes[0], 150)
+ self.generate(self.nodes[1], 200, sync_fun=lambda: self.sync_blocks(self.nodes[0:2]))
+ self.generate(self.nodes[0], 150, sync_fun=self.no_op)
# Then mine enough full blocks to create more than 550MiB of data
mine_large_blocks(self.nodes[0], 645)
@@ -211,7 +210,7 @@ class PruneTest(BitcoinTestFramework):
self.disconnect_nodes(1, 2)
self.log.info("Generating new longer chain of 300 more blocks")
- self.generate(self.nodes[1], 300)
+ self.generate(self.nodes[1], 300, sync_fun=self.no_op)
self.log.info("Reconnect nodes")
self.connect_nodes(0, 1)
@@ -263,7 +262,7 @@ class PruneTest(BitcoinTestFramework):
self.nodes[0].invalidateblock(curchainhash)
assert_equal(self.nodes[0].getblockcount(), self.mainchainheight)
assert_equal(self.nodes[0].getbestblockhash(), self.mainchainhash2)
- goalbesthash = self.generate(self.nodes[0], blocks_to_mine)[-1]
+ goalbesthash = self.generate(self.nodes[0], blocks_to_mine, sync_fun=self.no_op)[-1]
goalbestheight = first_reorg_height + 1
self.log.info("Verify node 2 reorged back to the main chain, some blocks of which it had to redownload")
@@ -306,7 +305,7 @@ class PruneTest(BitcoinTestFramework):
assert_equal(block1_details["nTx"], len(block1_details["tx"]))
# mine 6 blocks so we are at height 1001 (i.e., above PruneAfterHeight)
- self.generate(node, 6)
+ self.generate(node, 6, sync_fun=self.no_op)
assert_equal(node.getblockchaininfo()["blocks"], 1001)
# Pruned block should still know the number of transactions
@@ -337,7 +336,7 @@ class PruneTest(BitcoinTestFramework):
assert has_block(2), "blk00002.dat is still there, should be pruned by now"
# advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat)
- self.generate(node, 288)
+ self.generate(node, 288, sync_fun=self.no_op)
prune(1000)
assert not has_block(2), "blk00002.dat is still there, should be pruned by now"
assert not has_block(3), "blk00003.dat is still there, should be pruned by now"