re-enable wallet in autoprune #6057

pull jonasschnelli wants to merge 3 commits into bitcoin:master from jonasschnelli:2015/04/autoprune_wallet changing 2 files +24 −6
  1. jonasschnelli commented at 8:01 PM on April 24, 2015: contributor

    No description provided.

  2. morcos commented at 8:18 PM on April 24, 2015: member

    Nice! I'm glad you looked at this.

    The way you checked pindexRescan isn't sufficient however. You can't assume a pruned node has all the blocks past a certain point. Blocks are deleted from disk in the order they were written, which doesn't necessarily correspond with order in the chain. But perhaps you could scan backwards from the Tip until you get to either pindexRescan or one which isn't BLOCK_HAVE_DATA.

  3. jonasschnelli commented at 8:26 PM on April 24, 2015: contributor

    Right. I did ignore the fact that blocks are not fly in in order. Will change it to your proposed way of scanning backwards.

    Same needs to be done for #6058 (edit: already correct there)

  4. in src/init.cpp:None in 37cf0f43fd outdated
     712 | -            if (SoftSetBoolArg("-disablewallet", true))
     713 | -                LogPrintf("%s : parameter interaction: -prune -> setting -disablewallet=1\n", __func__);
     714 | -            else
     715 | -                return InitError(_("Can't run with a wallet in prune mode."));
     716 | +        if (GetBoolArg("-rescan", false)) {
     717 | +            return InitError(_("Rescans are not possible in pruned mode. You might use -reindex which then download the whole blockchain again."));
    


    PRabahy commented at 10:47 PM on April 24, 2015:

    This message is unclear to me. Do you mean: "Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."?


    jonasschnelli commented at 6:59 AM on April 25, 2015:

    Thanks! English is not my mother language and I always struggle with it. Feel free to also correct/rewrite the other warnings and errors (as well as the code comments).

  5. jonasschnelli force-pushed on Apr 26, 2015
  6. jonasschnelli commented at 12:52 PM on April 26, 2015: contributor

    Fixed pindexRescan check mentioned by @morcos.

  7. jonasschnelli force-pushed on Apr 26, 2015
  8. jonasschnelli force-pushed on Apr 26, 2015
  9. sipa commented at 12:30 PM on April 27, 2015: member

    Concept & code review ACK, but this definitely needs testing.

  10. jonasschnelli commented at 11:32 AM on April 29, 2015: contributor

    Also applied an additional test during wallet catchup-rescan if the previous block has TXs but no data to be sure we have pruned this block.

  11. jonasschnelli force-pushed on Apr 30, 2015
  12. jonasschnelli force-pushed on Apr 30, 2015
  13. laanwj added the label Wallet on May 6, 2015
  14. jonasschnelli force-pushed on May 8, 2015
  15. PRabahy cross-referenced this on May 27, 2015 from issue Autoprune release notes included by mrbandrews
  16. [autoprune] allow wallet in pruned mode 3201035f22
  17. [RPC] disable import functions in pruned mode
    import functions could lead to a rescan beyond prune level
    7a12119d7a
  18. [squashme] improve/corrects prune mode detection test for required wallet rescans 7e6569ea5b
  19. jonasschnelli force-pushed on May 28, 2015
  20. jonasschnelli commented at 7:01 AM on May 28, 2015: contributor

    Rebased.

  21. in src/init.cpp:None in 7e6569ea5b
     723 | -            if (SoftSetBoolArg("-disablewallet", true))
     724 | -                LogPrintf("%s : parameter interaction: -prune -> setting -disablewallet=1\n", __func__);
     725 | -            else
     726 | -                return InitError(_("Can't run with a wallet in prune mode."));
     727 | +        if (GetBoolArg("-rescan", false)) {
     728 | +            return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
    


    luke-jr commented at 2:58 AM on June 2, 2015:

    What prevents this error if the user has passed -reindex? In particular, a pruned node may not have the space for the whole blockchain, and may need to redownload it with pruning enabled.

    (... btw, does -reindex actually work correctly with pruned data? I think last time I tried, it ignored blocks after the first missing one, and redownloaded/reappended them...)

  22. laanwj commented at 10:32 AM on June 10, 2015: member

    utACK.

  23. laanwj merged this on Jun 10, 2015
  24. laanwj closed this on Jun 10, 2015

  25. laanwj referenced this in commit ac5476e2c1 on Jun 10, 2015
  26. laanwj cross-referenced this on Jun 15, 2015 from issue Autoprune by rdponticelli
  27. luke-jr referenced this in commit 3bb96b264f on Dec 28, 2015
  28. str4d cross-referenced this on Mar 29, 2017 from issue Bitcoin 0.12 wallet PRs by str4d
  29. jnewbery cross-referenced this on May 7, 2018 from issue Refactor: separate wallet from node by ryanofsky
  30. daira cross-referenced this on Jul 31, 2019 from issue Re-enable wallet when pruning by daira
  31. str4d cross-referenced this on Nov 14, 2019 from issue Bitcoin 0.12 wallet PRs 1 by str4d
  32. zkbot referenced this in commit 5e26d48a39 on Dec 3, 2019
  33. bitcoin locked this on Sep 8, 2021

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-05-20 06:55 UTC