Page MenuHomePhabricator

[gui] do not enable pruning by default
ClosedPublic

Authored by PiRK on Oct 30 2020, 08:01.

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC1e6e4031d320: [gui] do not enable pruning by default
Summary

Enabling pruning by default on the intro screen, when the selected data directory does not have enough disk space available to store the entire blockchain, can cause accidental pruning. When the filesystem containing the data is not mounted when bitcoin-qt is started, the intro screen is shown with the usual data directory selected and the pruning option checked. If the file system is then mounted (e.g. external hard drive connected) and the user does not notice that pruning is selected, the blockchain is pruned after he clicks OK. See also https://github.com/bitcoin/bitcoin/issues/19291

Besides that, if a user selects pruning and then changes the data directory, it should not unselect the option.

This commit removes default pruning behavior introduced in D7956, no matter how much disk space is detected on the selected filesystem. Pruning can always be activated later if needed, from the menu.

Test Plan

Run bitcoin-qt in a way that causes the intro screen to be displayed:
ninja && src/qt/bitcoin-qt -choosedatadir /does/not/exist

Select data directories with various available disk space (less than 10GB, between 10GB and the current blockchain size, more than the current blockchain size), and make sure that this does not automatically check the pruning option.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 30 2020, 08:01
PiRK requested review of this revision.Oct 30 2020, 08:01
jasonbcox added a subscriber: jasonbcox.

I also want to point out that encouraging users to run pruned nodes isn't very important. The Core crowd will likely disagree, but this patch is clearly the right way to go to not introduce an avenue for accidental data loss. Users that are concerned about disk space should have their node configured accordingly.

This revision is now accepted and ready to land.Oct 30 2020, 18:20
This revision was automatically updated to reflect the committed changes.