@@ -42,7 +42,7 @@ use std::collections::BTreeMap;
4242#[ cfg( any( feature = "electrum" , feature = "esplora" ) ) ]
4343use std:: collections:: HashSet ;
4444use std:: convert:: TryFrom ;
45- #[ cfg( feature = "repl" ) ]
45+ #[ cfg( any ( feature = "repl" , feature = "electrum" , feature = "esplora" ) ) ]
4646use std:: io:: Write ;
4747use std:: str:: FromStr ;
4848
@@ -580,7 +580,7 @@ pub(crate) async fn handle_online_wallet_subcommand(
580580 while let Some ( info) = info_subscriber. recv ( ) . await {
581581 match info {
582582 Info :: TxGossiped ( wtxid) => {
583- tracing:: info!( "Succuessfully broadcast WTXID: {wtxid}" ) ;
583+ tracing:: info!( "Successfully broadcast WTXID: {wtxid}" ) ;
584584 break ;
585585 }
586586 Info :: ConnectionsMet => {
@@ -745,11 +745,11 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
745745 subcommand : WalletSubCommand :: OnlineWalletSubCommand ( online_subcommand) ,
746746 } => {
747747 let network = cli_opts. network ;
748+ let home_dir = prepare_home_dir ( cli_opts. datadir ) ?;
749+ let wallet_name = & wallet_opts. wallet ;
750+ let database_path = prepare_wallet_db_dir ( wallet_name, & home_dir) ?;
748751 #[ cfg( feature = "sqlite" ) ]
749752 let result = {
750- let home_dir = prepare_home_dir ( cli_opts. datadir ) ?;
751- let wallet_name = & wallet_opts. wallet ;
752- let database_path = prepare_wallet_db_dir ( wallet_name, & home_dir) ?;
753753 let mut persister = match & wallet_opts. database_type {
754754 #[ cfg( feature = "sqlite" ) ]
755755 DatabaseType :: Sqlite => {
@@ -762,7 +762,7 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
762762
763763 let mut wallet = new_persisted_wallet ( network, & mut persister, & wallet_opts) ?;
764764 let blockchain_client =
765- new_blockchain_client ( & wallet_opts, & wallet, Some ( database_path) ) ?;
765+ new_blockchain_client ( & wallet_opts, & wallet, database_path) ?;
766766
767767 let result = handle_online_wallet_subcommand (
768768 & mut wallet,
@@ -775,6 +775,9 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
775775 } ;
776776 #[ cfg( not( any( feature = "sqlite" ) ) ) ]
777777 let result = {
778+ let wallet = new_wallet ( network, & wallet_opts) ?;
779+ let blockchain_client =
780+ crate :: utils:: new_blockchain_client ( & wallet_opts, & wallet, database_path) ?;
778781 let mut wallet = new_wallet ( network, & wallet_opts) ?;
779782 handle_online_wallet_subcommand ( & mut wallet, blockchain_client, online_subcommand)
780783 . await ?
@@ -871,7 +874,7 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
871874 & mut wallet,
872875 & wallet_opts,
873876 line,
874- Some ( database_path. clone ( ) ) ,
877+ database_path. clone ( ) ,
875878 )
876879 . await ;
877880 #[ cfg( feature = "sqlite" ) ]
@@ -904,7 +907,7 @@ async fn respond(
904907 wallet : & mut Wallet ,
905908 wallet_opts : & WalletOpts ,
906909 line : & str ,
907- _datadir : Option < std:: path:: PathBuf > ,
910+ _datadir : std:: path:: PathBuf ,
908911) -> Result < bool , String > {
909912 use clap:: Parser ;
910913
0 commit comments