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
  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: 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. [autoprune] allow wallet in pruned mode 3201035f22
  16. [RPC] disable import functions in pruned mode
    import functions could lead to a rescan beyond prune level
    7a12119d7a
  17. [squashme] improve/corrects prune mode detection test for required wallet rescans 7e6569ea5b
  18. jonasschnelli force-pushed on May 28, 2015
  19. jonasschnelli commented at 7:01 am on May 28, 2015: contributor
    Rebased.
  20. in src/init.cpp: 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…)

  21. laanwj commented at 10:32 am on June 10, 2015: member
    utACK.
  22. laanwj merged this on Jun 10, 2015
  23. laanwj closed this on Jun 10, 2015

  24. laanwj referenced this in commit ac5476e2c1 on Jun 10, 2015
  25. luke-jr referenced this in commit 3bb96b264f on Dec 28, 2015
  26. zkbot referenced this in commit 5e26d48a39 on Dec 3, 2019
  27. MarcoFalke 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: 2024-12-18 18:12 UTC

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