Skip to content

Commit

Permalink
fix: automatic directory creation on wallet startup (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra-yse authored Mar 21, 2024
1 parent a55b496 commit a32fffe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/wallet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
fs,
sync::{Arc, Mutex},
thread,
time::Duration,
Expand Down Expand Up @@ -79,8 +80,10 @@ impl Wallet {
ElementsNetwork::ElementsRegtest { .. } => todo!(),
});

let swap_persister =
Persister::new(opts.db_root_path.unwrap_or(DEFAULT_SWAPS_DIR.to_string()));
let persister_path = opts.db_root_path.unwrap_or(DEFAULT_SWAPS_DIR.to_string());
fs::create_dir_all(&persister_path)?;

let swap_persister = Persister::new(persister_path);
swap_persister.init()?;

let wallet = Arc::new(Wallet {
Expand Down

0 comments on commit a32fffe

Please sign in to comment.