Skip to content

Commit

Permalink
wallet: fix saving of newly created wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jul 8, 2024
1 parent b3cdda6 commit 30ae979
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cli/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use strict_encoding::Ident;
use crate::cli::{Args, Config, DescriptorOpts, Exec};
use crate::wallet::fs::{LoadError, StoreError};
use crate::wallet::Save;
use crate::{coinselect, OpType, WalletAddr, WalletUtxo};
use crate::{coinselect, FsConfig, OpType, WalletAddr, WalletUtxo};

#[derive(Subcommand, Clone, PartialEq, Eq, Debug, Display)]
pub enum Command {
Expand Down Expand Up @@ -217,6 +217,10 @@ impl<O: DescriptorOpts> Exec for Args<Command, O> {
print!("Saving the wallet as '{name}' ... ");
let mut wallet = self.bp_wallet::<O::Descr>(&config)?;
let name = name.to_string();
wallet.set_fs_config(FsConfig {
path: self.general.wallet_dir(&name),
autosave: false,
})?;
wallet.set_name(name);
if let Err(err) = wallet.save() {
println!("error: {err}");
Expand Down

0 comments on commit 30ae979

Please sign in to comment.