changeset 26702:4d31d046decd

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)
author Wladimir J. van der Laan <laanwj@gmail.com>
date Thu, 23 Feb 2017 10:38:09 +0100
parents f9e290155672 ec26b0c88c74
children c366a982fcea
files
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/qa/rpc-tests/pruning.py	Wed Feb 22 13:03:37 2017 +0100
+++ b/qa/rpc-tests/pruning.py	Thu Feb 23 10:38:09 2017 +0100
@@ -18,6 +18,11 @@
 
 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 @@
 
         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