-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Optional parameter for rescans to start at a specified height #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not define this in the if (fRescan) block where it's used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
I tend to concept NACK. IMO the |
src/wallet/wallet.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be a special case since the default for -rescan is 0, and chainActive.Genesis() == chainActive[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sure, why not? The current behavior would have it rescan from genesis for the last address, and that behavior will still happen here. As for importmulti, I agree that would also be good. However, I think that the individual import RPCs should also have the same rescanning behavior that importmulti does. |
When importing an address, privkey, or pubkey, there is now an option which allows users to set the height from which to start rescanning to save time.
Add the optional parameter to the -rescan command line option to allow rescanning from a block height.
Add tests for the optional parameters to rescan from height for importaddress, importprivkey, and importpubkey.
5c2784e to
2297b6c
Compare
|
@achow101: Either we support no rescan for a single input (maybe together with a manual rescan like #7061) or each address/script/pubkey input call should support the same rescan flexibility. The question now is if we should support heights or timestamps (key birthday). IIRC discussions in #7061 showed that most devs prefer timestamps. |
|
100% agree with @jonasschnelli, importmulti with explicit key birthdays is the answer here, not adding yet another positional argument to RPC calls (yes, you can also use importmulti to import just one key). In time we can deprecate |
|
Agree with @laanwj and @jonasschnelli. For me batch calls are preferred. Still not sure about the name But let's not put aside the concept of |
@laanwj true but one can import one by one and then issue the rescan from the correct timestamp. |
I agree, but that's inferior in every way to just having one self-contained operation. |
@laanwj well this discussion is like However I see this like OpenGL Regarding |
|
@promag I think this is a bit different. If we would have had something like |
|
I think as long as we support/have a rescan |
|
Sorry, I meant |
|
We've talked about changing Since the introduction of importprivkey without rescan, it became useful again, since it was the only way to import multiple keys without a rescan after each. I really think we should stop encouraging these crazy schemes that require people to know there is such a thing as a rescan and rely on having blockchain data available. RPC calls should just work, not require hacks to bring the wallet in a consistent state after the fact, with possible atomicity issues. |
|
Concept NACK |
This PR adds optional parameters to the importprivkey, importaddress, and importpubkey RPCs to allow starting the rescan from a certain height instead of the genesis block. It also adds the optional paramter to the -rescan command line option.
This allows rescans to be shortened if the user knows the block in which the first transaction for his addresses was included in.