Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/dashpay/dash into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Oct 29, 2024
2 parents cb16aec + 93cfd5b commit cd5d0c3
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,6 @@ void OptionsModel::Init(bool resetSettings)
settings.setValue("nPruneSize", DEFAULT_PRUNE_TARGET_GB);
SetPruneEnabled(settings.value("bPrune").toBool());

// If GUI is setting prune, then we also must set disablegovernance and txindex
if (settings.value("bPrune").toBool()) {
if (gArgs.SoftSetBoolArg("-disablegovernance", true)) {
LogPrintf("%s: parameter interaction: -prune=true -> setting -disablegovernance=true\n", __func__);
addOverriddenOption("-disablegovernance");
}
if (gArgs.SoftSetBoolArg("-txindex", false)) {
LogPrintf("%s: parameter interaction: -prune=true -> setting -txindex=false\n", __func__);
addOverriddenOption("-txindex");
}
}

if (!settings.contains("nDatabaseCache"))
settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
if (!gArgs.SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
Expand Down Expand Up @@ -405,11 +393,19 @@ void OptionsModel::SetPruneEnabled(bool prune, bool force)
std::string prune_val = prune ? ToString(prune_target_mib) : "0";
if (force) {
gArgs.ForceSetArg("-prune", prune_val);
if (prune) {
gArgs.ForceSetArg("-disablegovernance", "1");
gArgs.ForceSetArg("-txindex", "0");
}
return;
}
if (!gArgs.SoftSetArg("-prune", prune_val)) {
addOverriddenOption("-prune");
}
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 cd5d0c3

Please sign in to comment.