Revert "Fix for many wallet config errors (#731)"
This reverts commit 7ceade4449.
This commit is contained in:
@@ -87,12 +87,11 @@ where
|
||||
None => None,
|
||||
},
|
||||
};
|
||||
// Check if config was provided, if not load default and set update to "true"
|
||||
let (wallet, update) = match wallet_config {
|
||||
Some(w) => (w, false),
|
||||
let wallet = match wallet_config {
|
||||
Some(w) => w,
|
||||
None => match default_config.members.as_ref() {
|
||||
Some(m) => (m.clone().wallet, true),
|
||||
None => (WalletConfig::default(), true),
|
||||
Some(m) => m.clone().wallet,
|
||||
None => WalletConfig::default(),
|
||||
},
|
||||
};
|
||||
let tor = match tor_config {
|
||||
@@ -137,16 +136,11 @@ where
|
||||
if config_file_name.exists() {
|
||||
return Ok(());
|
||||
}
|
||||
// default settings are updated if no config was provided, no support for top_dir/here
|
||||
let mut abs_path_node = std::env::current_dir()?;
|
||||
abs_path_node.push(self.data_dir.clone());
|
||||
let mut absolute_path_wallet = std::env::current_dir()?;
|
||||
absolute_path_wallet.push(self.data_dir.clone());
|
||||
|
||||
// if no config provided, update defaults
|
||||
if update == true {
|
||||
default_config.update_paths(&abs_path_node, &absolute_path_wallet);
|
||||
};
|
||||
let mut abs_path = std::env::current_dir()?;
|
||||
abs_path.push(self.data_dir.clone());
|
||||
|
||||
default_config.update_paths(&abs_path);
|
||||
let res =
|
||||
default_config.write_to_file(config_file_name.to_str().unwrap(), false, None, None);
|
||||
if let Err(e) = res {
|
||||
|
||||
@@ -128,8 +128,7 @@ impl NodeClient for HTTPNodeClient {
|
||||
verified: Some(false),
|
||||
});
|
||||
} else {
|
||||
error!("Unable to contact Node to get version info: {}, check your node is running", e);
|
||||
warn!("Warning: a) Node is offline, or b) 'node_api_secret_path' in 'grin-wallet.toml' is set incorrectly");
|
||||
error!("Unable to contact Node to get version info: {}", e);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user