-
Notifications
You must be signed in to change notification settings - Fork 592
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
wallet/wallet: prevent always rescanning from birthday block #575
Conversation
// birthday was rolled back due to a chain reorg, we'll dispatch a | ||
// rescan from our birthday block to ensure we detect all relevant | ||
// on-chain events from this point. | ||
if isInitialSync || isRecovery || birthdayRollback { |
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.
birthdayRollback
is never set.
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.
In this commit, we address an issue with the wallet where it would always request a rescan from the birthday block. This is very crucial for older wallets, as it'll potentially go through thousands of blocks. To address this, we'll now only request a rescan from our birthday if we're recovering our wallet from our seed, the birthday block was rolled back, or if we're performing our initial sync. Otherwise, we'll request a rescan from tip.
In this commit, we add a new key/value pair to the waddrmgr's sync bucket to store the verification status of the birthday block. This verification status determines whether the wallet has verified the correctness of its birthday block through its sanity check on startup.
…ock has been verified In this commit, we prevent any further sanity check attempts by the wallet if its correctness has previously been verified. We do this to ensure we don't unnecessarily attempt to find a new candidate.
…thin ImportPrivateKey In this commit, we set the verified bit to false upon setting the new birthday block to ensure its correctness as it was provided by the caller.
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.
LGTM 💎
In this commit, we address an issue with the wallet where it would
always request a rescan from the birthday block. This is very crucial
for older wallets, as it'll potentially go through thousands of blocks.
To address this, we'll now only request a rescan from our birthday if
we're recovering our wallet from our seed, the birthday block was rolled
back, or if we're performing our initial sync. Otherwise, we'll request
a rescan from tip.