Skip to content

Commit 564b580

Browse files
committed
test: Introduce MIN_BLOCKS_TO_KEEP constant
1 parent 71d9a7c commit 564b580

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/functional/feature_pruning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212

1313
from test_framework.blocktools import (
14+
MIN_BLOCKS_TO_KEEP,
1415
create_block,
1516
create_coinbase,
1617
)
@@ -333,7 +334,7 @@ def has_block(index):
333334
assert has_block(2), "blk00002.dat is still there, should be pruned by now"
334335

335336
# advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat)
336-
self.generate(node, 288, sync_fun=self.no_op)
337+
self.generate(node, MIN_BLOCKS_TO_KEEP, sync_fun=self.no_op)
337338
prune(1000)
338339
assert not has_block(2), "blk00002.dat is still there, should be pruned by now"
339340
assert not has_block(3), "blk00003.dat is still there, should be pruned by now"

test/functional/test_framework/blocktools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
NORMAL_GBT_REQUEST_PARAMS = {"rules": ["segwit"]}
6363
VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
64+
MIN_BLOCKS_TO_KEEP = 288
6465

6566

6667
def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl=None, txlist=None):

0 commit comments

Comments
 (0)