diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 1ad595119b..150ccb65ed 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -154,7 +154,6 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si default: ui->prune->setChecked(true); } - ui->prune->setEnabled(false); } ui->pruneMiB->setValue(m_prune_target_mib); ui->pruneMiB->setToolTip(ui->prune->toolTip()); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 287267e423..d3adfcc744 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -238,6 +238,9 @@ bool OptionsModel::Init(bilingual_str& error) // and we want command-line parameters to overwrite the GUI settings. for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath, MapPortUPnP, MapPortNatpmp, Listen, Server, PruneTristate, ProxyUse, ProxyUseTor, Language}) { + // isSettingIgnored will have a false positive here during first-run prune changes + if (option == PruneTristate && m_prune_forced_by_gui) continue; + std::string setting = SettingName(option); if (node().isSettingIgnored(setting)) addOverriddenOption("-" + setting); try { @@ -397,6 +400,7 @@ void OptionsModel::SetPruneTargetMiB(int prune_target_mib) // this point because this function is only called after the intro screen is // shown, before the node starts. node().forceSetting("prune", new_value); + m_prune_forced_by_gui = true; // Update settings.json if value configured in intro screen is different // from saved value. Avoid writing settings.json if bitcoin.conf value diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 482dfcbe08..26506ff62c 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -138,6 +138,7 @@ private: /* settings that were overridden by command-line */ QString strOverriddenByCommandLine; + bool m_prune_forced_by_gui{false}; static QString FontChoiceToString(const OptionsModel::FontChoice&); static FontChoice FontChoiceFromString(const QString&);