refactor wallet address caching into its own public method #537
refactor wallet address caching into its own public method #537notmandatory merged 2 commits intobitcoindevkit:masterfrom a5an0:offline-address-cache
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 |
LLFourn
left a comment
There was a problem hiding this comment.
This LGTM just a few cosmetic things that I think we should fix up.
|
Thanks for the feedback! updated. |
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_minewill only work properly if the owned-address is loaded in the database.This PR takes the address caching functionality out of
Wallet::syncand puts it in a new public method that is available to offline wallets.Wallet::syncuses this method internally.Checklists
All Submissions:
cargo fmtandcargo clippybefore committingCHANGELOG.md