]> Untitled Git - bdk-cli/commitdiff
Update handle offline fn and repl to work with online wallets
authorSteve Myers <steve@notmandatory.org>
Tue, 9 Feb 2021 18:21:22 +0000 (10:21 -0800)
committerSteve Myers <steve@notmandatory.org>
Tue, 9 Feb 2021 18:21:22 +0000 (10:21 -0800)
src/bdk_cli.rs
src/lib.rs

index 4e63b1a51bc6eec0b87a2a2362a21eb910d9c2f3..17ed3aa0dd801b72d7f14aba566f51849d52ebe3 100644 (file)
@@ -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,
                                 )
                             }
index 7eaab7275720fca3bbd12cd70d1c70c6c288a931..b5c05d9e0d481fad87c0dc431fab11709fc2b60a 100644 (file)
@@ -580,8 +580,8 @@ fn parse_outpoint(s: &str) -> Result<OutPoint, String> {
 ///
 /// Offline wallet sub-commands are described in [`OfflineWalletSubCommand`].
 #[maybe_async]
-pub fn handle_offline_wallet_subcommand<D>(
-    wallet: &Wallet<(), D>,
+pub fn handle_offline_wallet_subcommand<T, D>(
+    wallet: &Wallet<T, D>,
     offline_subcommand: OfflineWalletSubCommand,
 ) -> Result<serde_json::Value, Error>
 where