Browse Source

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)
0.15
Wladimir J. van der Laan 8 years ago
parent
commit
d14555de3d
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      qa/rpc-tests/pruning.py

7
qa/rpc-tests/pruning.py

@ -18,6 +18,11 @@ import os @@ -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): @@ -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

Loading…
Cancel
Save