aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_pruning.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-30 10:09:51 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-30 10:09:54 -0400
commit45d8b717785187ab3be86802f872565149158c61 (patch)
treed1fb178ccd6f37db0d2976bd79425438bc27d1f1 /test/functional/feature_pruning.py
parentce6762030f814bc737bb0a097c17201e0b2edbc5 (diff)
parentfafb55e2c2b257efd4e584f72adf62401c01d573 (diff)
Merge #15696: [qa] test_runner: Move feature_pruning to base tests
fafb55e2c2 [qa] test_runner: Move feature_pruning to base tests (MarcoFalke) 8728a66782 [tests] fix block time in feature_pruning.py (John Newbery) Pull request description: ACKs for commit fafb55: Tree-SHA512: 88abef94379fbad6629da11dccb080d5f0644490d6f2cc2756a33fac34bcf72e84245cef596dfae5a40f7a99b3f4da0dd85d306d4c1b452d310d3f36eef75a8b
Diffstat (limited to 'test/functional/feature_pruning.py')
-rwxr-xr-xtest/functional/feature_pruning.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 8fb7c49640..e2b3b2d544 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -35,16 +35,17 @@ def mine_large_blocks(node, n):
# followed by 950k of OP_NOP. This would be non-standard in a non-coinbase
# transaction but is consensus valid.
+ # Set the nTime if this is the first time this function has been called.
+ # A static variable ensures that time is monotonicly increasing and is therefore
+ # different for each block created => blockhash is unique.
+ if "nTimes" not in mine_large_blocks.__dict__:
+ mine_large_blocks.nTime = 0
+
# Get the block parameters for the first block
big_script = CScript([OP_RETURN] + [OP_NOP] * 950000)
best_block = node.getblock(node.getbestblockhash())
height = int(best_block["height"]) + 1
- try:
- # Static variable ensures that time is monotonicly increasing and is therefore
- # different for each block created => blockhash is unique.
- mine_large_blocks.nTime = min(mine_large_blocks.nTime, int(best_block["time"])) + 1
- except AttributeError:
- mine_large_blocks.nTime = int(best_block["time"]) + 1
+ mine_large_blocks.nTime = max(mine_large_blocks.nTime, int(best_block["time"])) + 1
previousblockhash = int(best_block["hash"], 16)
for _ in range(n):