From 735be18b33c59ba6a242ab56b65ac2e7e0cc398c Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Tue, 29 Mar 2022 17:17:43 -0700 Subject: [PATCH] Update sync and broadcast sub-commands for bdk 0.17 --- src/lib.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c1a1a0f..b812251 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -800,11 +800,7 @@ blockchain client and network connection. ))] pub enum OnlineWalletSubCommand { /// Syncs with the chosen blockchain server - Sync { - /// max addresses to consider - #[structopt(short = "v", long = "max_addresses")] - max_addresses: Option, - }, + Sync, /// Broadcasts a transaction to the network. Takes either a raw transaction or a PSBT to extract Broadcast { /// Sets the PSBT to sign @@ -1094,12 +1090,11 @@ where use bdk::SyncOptions; match online_subcommand { - Sync { max_addresses } => { + Sync => { maybe_await!(wallet.sync( blockchain, SyncOptions { progress: Some(Box::new(log_progress())), - max_addresses, } ))?; Ok(json!({})) @@ -1115,8 +1110,8 @@ where (Some(_), Some(_)) => panic!("Both `psbt` and `tx` options not allowed"), (None, None) => panic!("Missing `psbt` and `tx` option"), }; - let txid = maybe_await!(blockchain.broadcast(&tx))?; - Ok(json!({ "txid": txid })) + maybe_await!(blockchain.broadcast(&tx))?; + Ok(json!({ "txid": tx.txid() })) } #[cfg(feature = "reserves")] ProduceProof { msg } => { -- 2.49.0