changeset 26701:ec26b0c88c74

Fix pruning test broken by 2 hour manual prune window Regression happened in 91fb506 Add two hour buffer to manual pruning.
author Russell Yanofsky <russ@yanofsky.org>
date Tue, 21 Feb 2017 12:57:30 -0500
parents b4b60ce5f4a3
children 4d31d046decd
files qa/rpc-tests/pruning.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/qa/rpc-tests/pruning.py	Tue Feb 21 15:13:13 2017 +0100
+++ b/qa/rpc-tests/pruning.py	Tue Feb 21 12:57:30 2017 -0500
@@ -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