Pruning should be based on bitcoin.conf #245

issue ghost openend this issue on March 12, 2021
  1. ghost commented at 2:21 am on March 12, 2021: none

    image

    Its mentioned that options set in GUI will be overridden by the configuration file. I had nothing for mainnet in bitcoin.conf, removed testnet=1 and prune=555 for testnet, saved new datadir path for external drive that had mainnet synced.

    I launched bitcoin-qt assuming it will not prune anything because there is nothing mentioned in bitcoin.conf, it deleted all my data and pruning was done based on GUI options which had 2 GB saved either by default or maybe I saved it in past.

    Expected behavior

    If bitcoin.conf does not mention anything about pruning it should not prune. If GUI for mainnet had pruning enabled in GUI, it should be saved automatically in bitcoin.conf as well to avoid the confusion and things remain in sync.

    Actual behavior

    Pruning is done based on GUI options

    To reproduce

    Sync a full node. Maybe testnet which will take less time.

    Use the blocks and chainstate in other node (which had pruning enabled in GUI) using datadir and bitcoin.conf doesn’t have anything else.

    Launch bitcoin-qt

    System information

    Bitcoin Core v 0.21.0. Ubuntu 20.04.2 LTS.

  2. unknown added the label Bug on Mar 12, 2021
  3. unknown renamed this:
    Pruning should be done based on bitcoin.conf
    Pruning should be based on bitcoin.conf
    on Mar 12, 2021
  4. hebasto commented at 10:33 am on March 12, 2021: member

    @prayank23

    If GUI for mainnet had pruning enabled in GUI, it should be saved automatically in bitcoin.conf as well to avoid the confusion and things remain in sync.

    It is a common consensus that, for safety, the opposite seems correct. From doc/files.md:

    File is not written to by the software and must be created manually.

  5. ghost commented at 6:21 pm on March 12, 2021: none

    @hebasto How about adding a confirmation window before this pruning begins based on GUI settings? If user clicks YES, prune based on GUI settings. If user clicks NO, do not prune based on GUI settings and disable pruning.

    This confirmation can be triggered if pruning is enabled in GUI settings and not found in bitcoin.conf during splash screen.

  6. ghost commented at 8:57 am on March 15, 2021: none
  7. rebroad commented at 9:35 pm on April 26, 2021: contributor

    It works fine if I comment this line and launch bitcoin-qt

    https://github.com/bitcoin-core/gui/blob/6bc51af5c2f29882055dbbb917bbc42ab313164a/src/init.cpp#L1830

    so, a one-line fix?

  8. ghost commented at 10:09 pm on April 26, 2021: none

    so, a one-line fix?

    I am not sure why this line exists and if removing this will break something else.

  9. Rspigler commented at 3:08 am on April 27, 2021: contributor

    I launched bitcoin-qt assuming it will not prune anything because there is nothing mentioned in bitcoin.conf

    It should not prune if you set prune=0 in the config file. But having nothing in the config file is not the same as stating Do Not Prune. Configuration file should override GUI settings

  10. ghost commented at 3:40 am on April 27, 2021: none

    It should not prune if you set prune=0 in the config file.

    Interesting. I think I will close this issue for now but this problem needs a better solution because if a software is deleting such important data for user, there needs to be atleast some warning or confirmation message.

  11. unknown closed this on Apr 27, 2021

  12. hebasto commented at 8:49 am on April 27, 2021: member

    Configuration file should override GUI settings

    More info: doc/bitcoin-conf.md

  13. Alex20129 commented at 0:57 am on January 25, 2022: none

    It should not prune if you set prune=0 in the config file. But having nothing in the config file is not the same as stating Do Not Prune. Configuration file should override GUI settings

    Having nothing in the config file is the same as having “prune=[defaultValue]”. I assume, “defaultValue” = “0” in this case, because we talking about days of waiting and hundreds of gigabytes of data, which was downloaded for reasons.

  14. bitcoin-core locked this on Jan 25, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 12:20 UTC

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