Skip to content

Commit

Permalink
Fix pruning test broken by 2 hour manual prune window
Browse files Browse the repository at this point in the history
Regression happened in 91fb506 Add two hour buffer to manual pruning.

Github-Pull: #9820
Rebased-From: 874c736
  • Loading branch information
ryanofsky authored and laanwj committed Feb 23, 2017
1 parent 9d3f9d2 commit 599c69a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qa/rpc-tests/pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down Expand Up @@ -239,7 +244,7 @@ def manual_test(self, node_number, use_timestamp):

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

Expand Down

0 comments on commit 599c69a

Please sign in to comment.