aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-23 10:38:09 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-23 10:38:26 +0100
commitd14555de3de9128f3e1d061c51e00dc560513978 (patch)
tree9000cd6543ce9d15366a88138ca76681d3b8664e /qa/rpc-tests
parentbed5b30a5622782b35d0d28fccde979e188901f1 (diff)
parent874c7363d794c18a3b46d3d2a03f19c88f3a20cf (diff)
downloadbitcoin-d14555de3de9128f3e1d061c51e00dc560513978.tar.xz
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)
Diffstat (limited to 'qa/rpc-tests')
-rwxr-xr-xqa/rpc-tests/pruning.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py
index 9d155478e2..1e6d419186 100755
--- a/qa/rpc-tests/pruning.py
+++ b/qa/rpc-tests/pruning.py
@@ -18,6 +18,11 @@ import os
MIN_BLOCKS_TO_KEEP = 288
+# Rescans start at the earliest block up to 2 hours before a key timestamp, so
+# the manual prune RPC avoids pruning blocks in the same window to be
+# compatible with pruning based on key creation time.
+RESCAN_WINDOW = 2 * 60 * 60
+
def calc_usage(blockdir):
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 @@ class PruneTest(BitcoinTestFramework):
def height(index):
if use_timestamp:
- return node.getblockheader(node.getblockhash(index))["time"]
+ return node.getblockheader(node.getblockhash(index))["time"] + RESCAN_WINDOW
else:
return index