]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#537: refactor wallet address caching into its own public...
authorSteve Myers <steve@notmandatory.org>
Wed, 2 Mar 2022 05:27:44 +0000 (21:27 -0800)
committerSteve Myers <steve@notmandatory.org>
Wed, 2 Mar 2022 05:28:31 +0000 (21:28 -0800)
commitadf7d0c126aab471d6c52cb3129c065c5c2a2063
tree4c2ea5a27db646be9702cf911bc2d04e5d429d5a
parentf0188f49a8579fd1180ec57d6379ac7ec4aadf73
parent4291f84d79d0952c5a78cee44378264e30614516
Merge bitcoindevkit/bdk#537: refactor wallet address caching into its own public method

edf2f0ce06d27a1434202b79306cd1e998b5614c refactor wallet address caching into its own public method for offline wallet use (a5an0)

Pull request description:

  ### 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 as `Wallet::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:

  * [X] I've signed all my commits
  * [X] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [X] I ran `cargo fmt` and `cargo clippy` before committing
  * [X] I've added docs for the new feature
  * [X] I've updated `CHANGELOG.md`

Top commit has no ACKs.

Tree-SHA512: 8ddc58d71457163bb20ff663ac508feb4e77000688161b63841a94db30b3f29f60f35fa2467bd99546123148873e3aed11e2f13ae6cbceda6605b83c227d9079