Skip to content

Commit

Permalink
fix: force correct -disablegovernance and -txindex values when pr…
Browse files Browse the repository at this point in the history
…uning is requested via init dialog
  • Loading branch information
UdjinM6 committed Oct 28, 2024
1 parent 64b20f0 commit 2d99b2c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,21 @@ void OptionsModel::SetPruneEnabled(bool prune, bool force)
settings.setValue("bPrune", prune);
const int64_t prune_target_mib = PruneGBtoMiB(settings.value("nPruneSize").toInt());
std::string prune_val = prune ? ToString(prune_target_mib) : "0";
auto maybe_adjust_dash_options = [](){
if (gArgs.GetArg("-prune", 0) > 0) {
gArgs.SoftSetBoolArg("-disablegovernance", true);
gArgs.SoftSetBoolArg("-txindex", false);
}
};
if (force) {
gArgs.ForceSetArg("-prune", prune_val);
maybe_adjust_dash_options();
if (prune) {
gArgs.ForceSetArg("-disablegovernance", "1");
gArgs.ForceSetArg("-txindex", "0");
}
return;
}
if (!gArgs.SoftSetArg("-prune", prune_val)) {
addOverriddenOption("-prune");
}
maybe_adjust_dash_options();
if (gArgs.GetArg("-prune", 0) > 0) {
gArgs.SoftSetBoolArg("-disablegovernance", true);
gArgs.SoftSetBoolArg("-txindex", false);
}
}

void OptionsModel::SetPruneTargetGB(int prune_target_gb, bool force)
Expand Down

0 comments on commit 2d99b2c

Please sign in to comment.