Is this correct? The following diff passes where this value is halved along with the corresponding heights in the pruneblockchain RPCs.
diff --git a/test/functional/rpc_prunelock.py b/test/functional/rpc_prunelock.py
index a122a6164a..9a2dd5b6c2 100755
--- a/test/functional/rpc_prunelock.py
+++ b/test/functional/rpc_prunelock.py
@@ -17,7 +17,7 @@ from test_framework.util import (
# Blocks needed to generate at minimum to allow pruning to work on
# regtest (with fastprune).
-INITIAL_BLOCKS = 1500
+INITIAL_BLOCKS = 750
class PruneLockTest(BitcoinTestFramework):
@@ -92,7 +92,7 @@ class PruneLockTest(BitcoinTestFramework):
{"id": "rpc:protect_early"},
{"height": 2})
- prune_height_locked = node.pruneblockchain(500)
+ prune_height_locked = node.pruneblockchain(250)
assert self.has_block_file(node, 0), "blk00000.dat should still exist with prune lock active"
self.log.info("Test that removing the prune lock allows further pruning")
@@ -101,7 +101,7 @@ class PruneLockTest(BitcoinTestFramework):
{"id": "rpc:protect_early"}, {},
should_not_find=True)
- prune_height_unlocked = node.pruneblockchain(500)
+ prune_height_unlocked = node.pruneblockchain(250)
assert_greater_than(prune_height_unlocked, prune_height_locked)
assert not self.has_block_file(node, 0), "blk00000.dat should be pruned after lock removal"
@@ -142,15 +142,15 @@ class PruneLockTest(BitcoinTestFramework):
node = self.nodes[0]
self.log.info("Test -prunelockheight with explicit height")
- self.restart_node(0, extra_args=["-prune=1", "-prunelockheight=500"])
+ self.restart_node(0, extra_args=["-prune=1", "-prunelockheight=250"])
assert_array_result(node.listprunelocks()["prune_locks"],
{"id": "init"},
- {"height": 500})
+ {"height": 250})
self.log.info("Test -prunelockheight can coexist with RPC locks")
node.setprunelock("mylock", "add", 100)
locks = node.listprunelocks()["prune_locks"]
- assert_array_result(locks, {"id": "init"}, {"height": 500})
+ assert_array_result(locks, {"id": "init"}, {"height": 250})
assert_array_result(locks, {"id": "rpc:mylock"}, {"height": 100})
node.setprunelock("mylock", "remove")
Based it off of this conditional:
https://github.com/bitcoin/bitcoin/blob/142e86a65c8a809911e37ead5ece63ad7854077e/src/kernel/chainparams.cpp#L603