Add SyncOptions as the second argument to Wallet::sync

The current options are awkward and it would be good if we could
introduce more in the future without breaking changes.
This commit is contained in:
LLFourn
2022-01-27 16:52:53 +11:00
parent 326bfe82a8
commit 410a51355b
13 changed files with 124 additions and 110 deletions

View File

@@ -10,7 +10,6 @@
// licenses.
use bdk::blockchain::compact_filters::*;
use bdk::blockchain::noop_progress;
use bdk::database::MemoryDatabase;
use bdk::*;
use bitcoin::*;
@@ -36,7 +35,7 @@ fn main() -> Result<(), CompactFiltersError> {
let database = MemoryDatabase::default();
let wallet = Arc::new(Wallet::new(descriptor, None, Network::Testnet, database).unwrap());
wallet.sync(&blockchain, noop_progress(), None).unwrap();
wallet.sync(&blockchain, SyncOptions::default()).unwrap();
info!("balance: {}", wallet.get_balance()?);
Ok(())
}