Enable wallet key imports without rescan in pruned mode.#6645
Conversation
Complete rescan is incompatible with pruning, but rescan is optional on our wallet key import RPCs. Import on use is very useful in some common situations in conjunction with pruning, e.g. merchant payment tracking. This reenables importprivkey/importaddress/importpubkey when rescan is not used. In the future we should consider changing the rescan argument to allow depth or date to allow limited rescanning when compatible with the retained block depth.
|
I only performed the most trivial of tests. I am opening this PR somewhat prematurely because I don't know why it wasn't done this way in the first place, and wanted to find out if there was some huge reason I was missing before I spent more time testing. :) |
|
@jonasschnelli Above question is wrt 7a12119. |
|
Nice! Right. I should have this done in the fist place. utACK. |
|
There is also a PR that would optimize importing depth: |
|
Awesome. Okay I'll run it through some more test cases then! |
|
utACK |
|
utACK && concept ACK |
|
I've tested this more extensively now and can't seem to break it. |
There was a problem hiding this comment.
Maybe "Wallet rescanning is disabled in pruned mode"?
There was a problem hiding this comment.
Technically it is the blockchain that is rescanned. But these options have a boolean parameter "rescan" which defaults, so what its saying is that this option is disabled.
I think if I were to clarify this further I would say that the rescan option was disabled. Or maybe to be kind to translaters say something like the requested rescan depth was too deep (as I expect we'll further parameterize this in the future).
There was a problem hiding this comment.
You could just say "The -rescan option is disabled in pruned mode" which would be more clear (to me at least :)
There was a problem hiding this comment.
But this isn't about the -rescan option, but rescans triggered some other way. I think the message is OK.
There was a problem hiding this comment.
The only improvement I can think of would be to add a comment to the error message that it is possible to pass 'false' as the rescan parameter to avoid this error.
You don't have to worry about translators, RPC error messages aren't translated.
|
utACK |
77c6072 Enable wallet key imports without rescan in pruned mode. (Gregory Maxwell)
Complete rescan is incompatible with pruning, but rescan is optional on our wallet key import RPCs. Import on use is very useful in some common situations in conjunction with pruning, e.g. merchant payment tracking. This reenables importprivkey/importaddress when rescan is not used. In the future we should consider changing the rescan argument to allow depth or date to allow limited rescanning when compatible with the retained block depth. Github-Pull: bitcoin#6645 Partial-Rebased-From: 77c6072
Complete rescan is incompatible with pruning, but rescan is optional on
our wallet key import RPCs. Import on use is very useful in some common
situations in conjunction with pruning, e.g. merchant payment tracking.
This reenables importprivkey/importaddress/importpubkey when rescan
is not used.
In the future we should consider changing the rescan argument to allow depth
or date to allow limited rescanning when compatible with the retained
block depth.