-
Notifications
You must be signed in to change notification settings - Fork 389
refactor wallet address caching into its own public method #537
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
refactor wallet address caching into its own public method #537
Conversation
Concept ACK. Like @a5an0 mentions, we need this when you give your descriptors over to another machine which generates addresses without your knowledge and then hands you a PSBT to sign. HW wallets like coldcard do this kind of thing too. An important side note is that caching addresses is not even technically necessary for |
Try rebasing on the lastest |
Concept ACK btw, this seems useful.
Yes, this would be great. The current |
Once #502 is merged you'll need to rebase to pickup some CI changes that are in that PR. Then this one looks good to go. |
rebased onto master to pick up CI changes |
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 LGTM just a few cosmetic things that I think we should fix up.
Thanks for the feedback! updated. |
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.
ACK 66c6158 squash and merge
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.
ACK edf2f0c
Description
Currently, the only way to ensure that a wallet's internal database has addresses loaded and cached is through
Wallet::sync
: that function generates and caches up to a number of addresses if they aren't already in the database, and then uses the wallet's blockchain client to sync those addresses. If you are using an offline wallet, there is no mechanism to ensure that the database has addresses loaded. This is a problem for usecases like an offline wallet being used as a multisig signer and wanting to validate change addresses asWallet::is_mine
will only work properly if the owned-address is loaded in the database.This PR takes the address caching functionality out of
Wallet::sync
and puts it in a new public method that is available to offline wallets.Wallet::sync
uses this method internally.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingCHANGELOG.md