Skip to content

Commit

Permalink
GUI: Options: Set the range of pruning size before loading its value
Browse files Browse the repository at this point in the history
Without this, an out-of-default-range value gets limited to the range
  • Loading branch information
luke-jr committed Apr 11, 2019
1 parent 6f6514a commit 4ddeb2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ void OptionsDialog::setModel(OptionsModel *_model)
if (_model->isRestartRequired())
showRestartWarning(true);

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

QString strLabel = _model->getOverriddenByCommandLine();
if (strLabel.isEmpty())
strLabel = tr("none");
Expand All @@ -158,10 +162,6 @@ void OptionsDialog::setModel(OptionsModel *_model)
mapper->toFirst();

updateDefaultProxyNets();

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

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

0 comments on commit 4ddeb2f

Please sign in to comment.