mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
merge bitcoin#24626: disallow reindex-chainstate when pruning
This commit is contained in:
parent
bcd24a25e3
commit
c65ec190c5
@ -1156,12 +1156,14 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
|||||||
nLocalServices = ServiceFlags(nLocalServices | NODE_COMPACT_FILTERS);
|
nLocalServices = ServiceFlags(nLocalServices | NODE_COMPACT_FILTERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if using block pruning, then disallow txindex, coinstatsindex and require disabling governance validation
|
|
||||||
if (args.GetArg("-prune", 0)) {
|
if (args.GetArg("-prune", 0)) {
|
||||||
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX))
|
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX))
|
||||||
return InitError(_("Prune mode is incompatible with -txindex."));
|
return InitError(_("Prune mode is incompatible with -txindex."));
|
||||||
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
|
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
|
||||||
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
|
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
|
||||||
|
if (args.GetBoolArg("-reindex-chainstate", false)) {
|
||||||
|
return InitError(_("Prune mode is incompatible with -reindex-chainstate. Use full -reindex instead."));
|
||||||
|
}
|
||||||
if (!args.GetBoolArg("-disablegovernance", !DEFAULT_GOVERNANCE_ENABLE)) {
|
if (!args.GetBoolArg("-disablegovernance", !DEFAULT_GOVERNANCE_ENABLE)) {
|
||||||
return InitError(_("Prune mode is incompatible with -disablegovernance=false."));
|
return InitError(_("Prune mode is incompatible with -disablegovernance=false."));
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,10 @@ class PruneTest(BitcoinTestFramework):
|
|||||||
expected_msg='Error: Prune mode is incompatible with -coinstatsindex.',
|
expected_msg='Error: Prune mode is incompatible with -coinstatsindex.',
|
||||||
extra_args=['-prune=550', '-coinstatsindex'],
|
extra_args=['-prune=550', '-coinstatsindex'],
|
||||||
)
|
)
|
||||||
|
self.nodes[0].assert_start_raises_init_error(
|
||||||
|
expected_msg='Error: Prune mode is incompatible with -reindex-chainstate. Use full -reindex instead.',
|
||||||
|
extra_args=['-prune=550', '-reindex-chainstate'],
|
||||||
|
)
|
||||||
self.nodes[0].assert_start_raises_init_error(
|
self.nodes[0].assert_start_raises_init_error(
|
||||||
expected_msg='Error: Prune mode is incompatible with -disablegovernance=false.',
|
expected_msg='Error: Prune mode is incompatible with -disablegovernance=false.',
|
||||||
extra_args=['-prune=550', '-disablegovernance=false'],
|
extra_args=['-prune=550', '-disablegovernance=false'],
|
||||||
|
Loading…
Reference in New Issue
Block a user