diff options
| author | Luke Dashjr <[email protected]> | 2019-04-11 23:39:59 +0000 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2019-04-18 17:47:08 +0200 |
| commit | 55462077fdf8fc084a8b7190d608b8546a4ebf09 (patch) | |
| tree | aa25c1b6d050e9fbd6e3cd10212cb40e1e471970 /src | |
| parent | Merge #15818: [0.18] doc backports (diff) | |
| download | discoin-55462077fdf8fc084a8b7190d608b8546a4ebf09.tar.xz discoin-55462077fdf8fc084a8b7190d608b8546a4ebf09.zip | |
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
Github-Pull: #15801
Rebased-From: 4ddeb2f860eee98fbe94725ea8885368068a03f2
Tree-SHA512: 64c18c8be6756fc0130d3fe934edb1ea7758877d4049c5729fa2adb05abb3af4e4bbe1d5f910224e16070aada5470637a35ed14b12391efd48cf035e8a22a949
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/optionsdialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 9094aeff5..b20a98bba 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -154,6 +154,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"); @@ -164,10 +168,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) */ |