diff --git a/src/config.rs b/src/config.rs index 5ed91b3..ffd9197 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,6 +15,7 @@ pub struct Config { pub network: Network, pub electrum_url: String, pub zmq_url: String, + pub data_dir: String, } impl Config { @@ -70,6 +71,10 @@ impl Config { .remove("zmq_url") .ok_or(Error::msg("No \"zmq_url\""))? .to_owned(), + data_dir: file_content + .remove("data_dir") + .ok_or(Error::msg("No \"data_dir\""))? + .to_owned(), }; Ok(config) diff --git a/src/main.rs b/src/main.rs index 8f83d7c..d7068c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -346,7 +346,7 @@ async fn main() -> Result<()> { .try_into()?; let mut app_dir = PathBuf::from_str(&env::var("HOME")?)?; - app_dir.push(".4nk"); + app_dir.push(config.data_dir); let mut wallet_file = app_dir.clone(); wallet_file.push(&config.wallet_name); let mut processes_file = app_dir.clone();