]> Untitled Git - bdk/commitdiff
Remove max_addresses sync param
authorLLFourn <lloyd.fourn@gmail.com>
Sun, 6 Mar 2022 23:44:41 +0000 (10:44 +1100)
committerLLFourn <lloyd.fourn@gmail.com>
Sun, 6 Mar 2022 23:44:41 +0000 (10:44 +1100)
You can do this with ensure_addresses_cached if you really want to.

CHANGELOG.md
src/wallet/mod.rs

index cad538d58b7d86d2f13b9fc81cef54128c382370..f0f06be410a92bd2aa73549ff7ba44a4673a2cc3 100644 (file)
@@ -21,6 +21,7 @@ To decouple the `Wallet` from the `Blockchain` we've made major changes:
 - Changed `Wallet::sync` to take a `Blockchain`.
 - Stop making a request for the block height when calling `Wallet:new`.
 - Added `SyncOptions` to capture extra (future) arguments to `Wallet::sync`.
+- Removed `max_addresses` sync parameter which determined how many addresses to cache before syncing since this can just be done with `ensure_addreses_cached`.
 
 ## [v0.16.1] - [v0.16.0]
 
@@ -432,4 +433,4 @@ final transaction is created by calling `finish` on the builder.
 [v0.14.0]: https://github.com/bitcoindevkit/bdk/compare/v0.13.0...v0.14.0
 [v0.15.0]: https://github.com/bitcoindevkit/bdk/compare/v0.14.0...v0.15.0
 [v0.16.0]: https://github.com/bitcoindevkit/bdk/compare/v0.15.0...v0.16.0
-[v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1
\ No newline at end of file
+[v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1
index 97f7bbb820280a9e2c7ad1f58e7a0016696b9b68..5ee2b9a4eb25ab10a7af890d4f9a4063084f4f23 100644 (file)
@@ -163,8 +163,6 @@ impl fmt::Display for AddressInfo {
 pub struct SyncOptions {
     /// The progress tracker which may be informed when progress is made.
     pub progress: Option<Box<dyn Progress>>,
-    /// The maximum number of new addresses to derive and cache on sync.
-    pub max_addresses: Option<u32>,
 }
 
 impl<D> Wallet<D>
@@ -1524,14 +1522,10 @@ where
     ) -> Result<(), Error> {
         debug!("Begin sync...");
 
-        let SyncOptions {
-            max_addresses,
-            progress,
-        } = sync_opts;
+        let SyncOptions { progress } = sync_opts;
         let progress = progress.unwrap_or_else(|| Box::new(NoopProgress));
 
-        let run_setup =
-            self.ensure_addresses_cached(max_addresses.unwrap_or(CACHE_ADDR_BATCH_SIZE))?;
+        let run_setup = self.ensure_addresses_cached(CACHE_ADDR_BATCH_SIZE)?;
 
         debug!("run_setup: {}", run_setup);
         // TODO: what if i generate an address first and cache some addresses?