Skip to content

Commit 45767fc

Browse files
committed
Remove max_addresses sync param
You can do this with ensure_addresses_cached if you really want to.
1 parent d03aa85 commit 45767fc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ To decouple the `Wallet` from the `Blockchain` we've made major changes:
2121
- Changed `Wallet::sync` to take a `Blockchain`.
2222
- Stop making a request for the block height when calling `Wallet:new`.
2323
- Added `SyncOptions` to capture extra (future) arguments to `Wallet::sync`.
24+
- Removed `max_addresses` sync parameter which determined how many addresses to cache before syncing since this can just be done with `ensure_addreses_cached`.
2425

2526
## [v0.16.1] - [v0.16.0]
2627

@@ -432,4 +433,4 @@ final transaction is created by calling `finish` on the builder.
432433
[v0.14.0]: https://github.com/bitcoindevkit/bdk/compare/v0.13.0...v0.14.0
433434
[v0.15.0]: https://github.com/bitcoindevkit/bdk/compare/v0.14.0...v0.15.0
434435
[v0.16.0]: https://github.com/bitcoindevkit/bdk/compare/v0.15.0...v0.16.0
435-
[v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1
436+
[v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1

src/wallet/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ impl fmt::Display for AddressInfo {
163163
pub struct SyncOptions {
164164
/// The progress tracker which may be informed when progress is made.
165165
pub progress: Option<Box<dyn Progress>>,
166-
/// The maximum number of new addresses to derive and cache on sync.
167-
pub max_addresses: Option<u32>,
168166
}
169167

170168
impl<D> Wallet<D>
@@ -1524,14 +1522,10 @@ where
15241522
) -> Result<(), Error> {
15251523
debug!("Begin sync...");
15261524

1527-
let SyncOptions {
1528-
max_addresses,
1529-
progress,
1530-
} = sync_opts;
1525+
let SyncOptions { progress } = sync_opts;
15311526
let progress = progress.unwrap_or_else(|| Box::new(NoopProgress));
15321527

1533-
let run_setup =
1534-
self.ensure_addresses_cached(max_addresses.unwrap_or(CACHE_ADDR_BATCH_SIZE))?;
1528+
let run_setup = self.ensure_addresses_cached(CACHE_ADDR_BATCH_SIZE)?;
15351529

15361530
debug!("run_setup: {}", run_setup);
15371531
// TODO: what if i generate an address first and cache some addresses?

0 commit comments

Comments
 (0)