Bugfix: GUI: Options: Initialise prune setting range before loading current value, and remove upper bound limit #15801

pull luke-jr wants to merge 2 commits into bitcoin:master from luke-jr:bugfix_gui_prune_range changing 1 files +4 −4
  1. luke-jr commented at 11:48 PM on April 11, 2019: member

    This fixes two bugs:

    1. The prune setting range was set after loading the current value. If users had a prune of (eg) 200, it would get limited to 99 before the range was raised. This is fixed by setting the range first.
    2. The prune setting was limited to <= the chainparams' "assumed blockchain size". There's no reason for this limit (the UX is the same either way), and there are use cases it breaks (eg, setting a prune size such that it begins pruning at some future point). Therefore, I raised it to the max value.

    This is a daggy fix, so should cleanly merge to both master and 0.18 branches.

  2. 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
    4ddeb2f860
  3. GUI: Options: Remove the upper-bound limit from pruning size setting
    Hypothetically, someone may wish to begin pruning at a future blockchain size, and there's no reason to limit it lower
    8a33f4d63f
  4. fanquake added the label GUI on Apr 11, 2019
  5. in src/qt/optionsdialog.cpp:153 in 8a33f4d63f
     147 | @@ -148,6 +148,10 @@ void OptionsDialog::setModel(OptionsModel *_model)
     148 |          if (_model->isRestartRequired())
     149 |              showRestartWarning(true);
     150 |  
     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, std::numeric_limits<int>::max());
    


    MarcoFalke commented at 1:01 AM on April 12, 2019:

    Why was this changed in the first place?

    Couldn't you restore the ui->pruneSize->setMinimum(nMinDiskSpace); like it was before?


    luke-jr commented at 1:09 AM on April 12, 2019:

    The default max is 99.


    promag commented at 2:00 PM on April 14, 2019:
  6. MarcoFalke commented at 1:11 PM on April 12, 2019: member

    utACK 8a33f4d63f9944f4877b3e2814b1582e72ceaa71

  7. luke-jr commented at 7:51 PM on April 12, 2019: member

    (should probably get tagged for 0.18 since we're doing another rc)

  8. promag commented at 2:02 PM on April 14, 2019: member

    utACK 8a33f4d.

  9. MarcoFalke added the label Needs gitian build on Apr 15, 2019
  10. fanquake added the label Needs backport on Apr 17, 2019
  11. fanquake added this to the milestone 0.18.0 on Apr 17, 2019
  12. laanwj commented at 3:40 PM on April 18, 2019: member

    utACK 8a33f4d63f9944f4877b3e2814b1582e72ceaa71

  13. laanwj referenced this in commit 55462077fd on Apr 18, 2019
  14. laanwj referenced this in commit a58d80d1b2 on Apr 18, 2019
  15. laanwj merged this on Apr 18, 2019
  16. laanwj closed this on Apr 18, 2019

  17. laanwj referenced this in commit f5aaeae0cd on Apr 18, 2019
  18. MarcoFalke removed the label Needs backport on Apr 18, 2019
  19. MarcoFalke removed the label Needs gitian build on Apr 18, 2019
  20. HashUnlimited referenced this in commit ac1f81debc on Apr 19, 2019
  21. HashUnlimited referenced this in commit a5466d24e3 on Apr 19, 2019
  22. goomario commented at 12:53 PM on July 8, 2020: none

    Look like QSpinBox::setRange() not effect on Qt5.9.8 macOS Catalina.

  23. jasonbcox referenced this in commit 654a805e96 on Oct 13, 2020
  24. PastaPastaPasta referenced this in commit 19cb999c02 on Sep 11, 2021
  25. PastaPastaPasta referenced this in commit b8ab50c1cd on Sep 11, 2021
  26. PastaPastaPasta referenced this in commit e7d9066cac on Sep 12, 2021
  27. DrahtBot locked this on Feb 15, 2022
Labels

Milestone
0.18.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me