Skip to content

Commit 4ddeb2f

Browse files
committed
GUI: Options: Set the range of pruning size before loading its value
Without this, an out-of-default-range value gets limited to the range
1 parent 6f6514a commit 4ddeb2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/qt/optionsdialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ void OptionsDialog::setModel(OptionsModel *_model)
148148
if (_model->isRestartRequired())
149149
showRestartWarning(true);
150150

151+
// Prune values are in GB to be consistent with intro.cpp
152+
static constexpr uint64_t nMinDiskSpace = (MIN_DISK_SPACE_FOR_BLOCK_FILES / GB_BYTES) + (MIN_DISK_SPACE_FOR_BLOCK_FILES % GB_BYTES) ? 1 : 0;
153+
ui->pruneSize->setRange(nMinDiskSpace, _model->node().getAssumedBlockchainSize());
154+
151155
QString strLabel = _model->getOverriddenByCommandLine();
152156
if (strLabel.isEmpty())
153157
strLabel = tr("none");
@@ -158,10 +162,6 @@ void OptionsDialog::setModel(OptionsModel *_model)
158162
mapper->toFirst();
159163

160164
updateDefaultProxyNets();
161-
162-
// Prune values are in GB to be consistent with intro.cpp
163-
static constexpr uint64_t nMinDiskSpace = (MIN_DISK_SPACE_FOR_BLOCK_FILES / GB_BYTES) + (MIN_DISK_SPACE_FOR_BLOCK_FILES % GB_BYTES) ? 1 : 0;
164-
ui->pruneSize->setRange(nMinDiskSpace, _model->node().getAssumedBlockchainSize());
165165
}
166166

167167
/* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */

0 commit comments

Comments
 (0)