Skip to content

Commit d14555d

Browse files
committed
Merge #9820: Fix pruning test broken by 2 hour manual prune window
874c736 Fix pruning test broken by 2 hour manual prune window (Russell Yanofsky)
2 parents bed5b30 + 874c736 commit d14555d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qa/rpc-tests/pruning.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
MIN_BLOCKS_TO_KEEP = 288
2020

21+
# Rescans start at the earliest block up to 2 hours before a key timestamp, so
22+
# the manual prune RPC avoids pruning blocks in the same window to be
23+
# compatible with pruning based on key creation time.
24+
RESCAN_WINDOW = 2 * 60 * 60
25+
2126

2227
def calc_usage(blockdir):
2328
return sum(os.path.getsize(blockdir+f) for f in os.listdir(blockdir) if os.path.isfile(blockdir+f)) / (1024. * 1024.)
@@ -239,7 +244,7 @@ def manual_test(self, node_number, use_timestamp):
239244

240245
def height(index):
241246
if use_timestamp:
242-
return node.getblockheader(node.getblockhash(index))["time"]
247+
return node.getblockheader(node.getblockhash(index))["time"] + RESCAN_WINDOW
243248
else:
244249
return index
245250

0 commit comments

Comments
 (0)