From 9fb50b1e7bd16683c65d77ece61bcc32e0f445e8 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Tue, 9 Feb 2021 10:21:22 -0800 Subject: [PATCH] Update handle offline fn and repl to work with online wallets --- src/bdk_cli.rs | 9 ++------- src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/bdk_cli.rs b/src/bdk_cli.rs index 4e63b1a..17ed3aa 100644 --- a/src/bdk_cli.rs +++ b/src/bdk_cli.rs @@ -24,7 +24,6 @@ use std::fs; use std::path::PathBuf; -use std::sync::Arc; use bitcoin::Network; use clap::AppSettings; @@ -186,10 +185,6 @@ fn main() { CliSubCommand::Repl { wallet_opts } => { let database = open_database(&wallet_opts); let online_wallet = new_online_wallet(network, &wallet_opts, database.clone()).unwrap(); - let online_wallet = Arc::new(online_wallet); - - let offline_wallet = new_offline_wallet(network, &wallet_opts, database).unwrap(); - let offline_wallet = Arc::new(offline_wallet); let mut rl = Editor::<()>::new(); @@ -231,13 +226,13 @@ fn main() { let result = match repl_subcommand { ReplSubCommand::OnlineWalletSubCommand(online_subcommand) => { bdk_cli::handle_online_wallet_subcommand( - &Arc::clone(&online_wallet), + &online_wallet, online_subcommand, ) } ReplSubCommand::OfflineWalletSubCommand(offline_subcommand) => { bdk_cli::handle_offline_wallet_subcommand( - &Arc::clone(&offline_wallet), + &online_wallet, offline_subcommand, ) } diff --git a/src/lib.rs b/src/lib.rs index 7eaab72..b5c05d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -580,8 +580,8 @@ fn parse_outpoint(s: &str) -> Result { /// /// Offline wallet sub-commands are described in [`OfflineWalletSubCommand`]. #[maybe_async] -pub fn handle_offline_wallet_subcommand( - wallet: &Wallet<(), D>, +pub fn handle_offline_wallet_subcommand( + wallet: &Wallet, offline_subcommand: OfflineWalletSubCommand, ) -> Result where