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-
jonasschnelli commented at 8:01 pm on April 24, 2015: contributor
-
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 eitherpindexRescan
or one which isn’t BLOCK_HAVE_DATA. -
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) -
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).jonasschnelli force-pushed on Apr 26, 2015jonasschnelli commented at 12:52 pm on April 26, 2015: contributorFixedpindexRescan
check mentioned by @morcos.jonasschnelli force-pushed on Apr 26, 2015jonasschnelli force-pushed on Apr 26, 2015sipa commented at 12:30 pm on April 27, 2015: memberConcept & code review ACK, but this definitely needs testing.jonasschnelli commented at 11:32 am on April 29, 2015: contributorAlso 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.jonasschnelli force-pushed on Apr 30, 2015jonasschnelli force-pushed on Apr 30, 2015laanwj added the label Wallet on May 6, 2015jonasschnelli force-pushed on May 8, 2015[autoprune] allow wallet in pruned mode 3201035f22[RPC] disable import functions in pruned mode
import functions could lead to a rescan beyond prune level
[squashme] improve/corrects prune mode detection test for required wallet rescans 7e6569ea5bjonasschnelli force-pushed on May 28, 2015jonasschnelli commented at 7:01 am on May 28, 2015: contributorRebased.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…)
laanwj commented at 10:32 am on June 10, 2015: memberutACK.laanwj merged this on Jun 10, 2015laanwj closed this on Jun 10, 2015
laanwj referenced this in commit ac5476e2c1 on Jun 10, 2015luke-jr referenced this in commit 3bb96b264f on Dec 28, 2015zkbot referenced this in commit 5e26d48a39 on Dec 3, 2019MarcoFalke locked this on Sep 8, 2021
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-11-17 06:12 UTC
More mirrored repositories can be found on mirror.b10c.me