Skip to content

Commit c65ec19

Browse files
committed
merge bitcoin#24626: disallow reindex-chainstate when pruning
1 parent bcd24a2 commit c65ec19

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/init.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,12 +1156,14 @@ bool AppInitParameterInteraction(const ArgsManager& args)
11561156
nLocalServices = ServiceFlags(nLocalServices | NODE_COMPACT_FILTERS);
11571157
}
11581158

1159-
// if using block pruning, then disallow txindex, coinstatsindex and require disabling governance validation
11601159
if (args.GetArg("-prune", 0)) {
11611160
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX))
11621161
return InitError(_("Prune mode is incompatible with -txindex."));
11631162
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
11641163
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
1164+
if (args.GetBoolArg("-reindex-chainstate", false)) {
1165+
return InitError(_("Prune mode is incompatible with -reindex-chainstate. Use full -reindex instead."));
1166+
}
11651167
if (!args.GetBoolArg("-disablegovernance", !DEFAULT_GOVERNANCE_ENABLE)) {
11661168
return InitError(_("Prune mode is incompatible with -disablegovernance=false."));
11671169
}

test/functional/feature_pruning.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ def test_invalid_command_line_options(self):
153153
expected_msg='Error: Prune mode is incompatible with -coinstatsindex.',
154154
extra_args=['-prune=550', '-coinstatsindex'],
155155
)
156+
self.nodes[0].assert_start_raises_init_error(
157+
expected_msg='Error: Prune mode is incompatible with -reindex-chainstate. Use full -reindex instead.',
158+
extra_args=['-prune=550', '-reindex-chainstate'],
159+
)
156160
self.nodes[0].assert_start_raises_init_error(
157161
expected_msg='Error: Prune mode is incompatible with -disablegovernance=false.',
158162
extra_args=['-prune=550', '-disablegovernance=false'],

0 commit comments

Comments
 (0)