mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-10-30 00:27:36 +00:00
temp fix for handling missing wallet dir
This commit is contained in:
parent
39b848329b
commit
d3c19e226c
1 changed files with 15 additions and 0 deletions
|
@ -196,6 +196,20 @@ async fn gen_app_gpg() {
|
||||||
debug!("gpg key: {}", gpg_key);
|
debug!("gpg key: {}", gpg_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Handles panic! for missing wallet directory
|
||||||
|
fn create_wallet_dir() {
|
||||||
|
let file_path = format!("/home/{}/.nevmes",
|
||||||
|
std::env::var("USER").unwrap_or(String::from("user")));
|
||||||
|
let s_output = std::process::Command::new("mkdir")
|
||||||
|
.args(["-p", &format!("{}/stagenet/wallet", file_path)])
|
||||||
|
.spawn().expect("failed to create dir");
|
||||||
|
debug!("{:?}", s_output);
|
||||||
|
let m_output = std::process::Command::new("mkdir")
|
||||||
|
.args(["-p", &format!("{}/wallet", file_path)])
|
||||||
|
.spawn().expect("failed to create dir");
|
||||||
|
debug!("{:?}", m_output);
|
||||||
|
}
|
||||||
|
|
||||||
/// Generate application wallet at startup if none exist
|
/// Generate application wallet at startup if none exist
|
||||||
async fn gen_app_wallet() {
|
async fn gen_app_wallet() {
|
||||||
info!("fetching application wallet");
|
info!("fetching application wallet");
|
||||||
|
@ -306,6 +320,7 @@ pub async fn start_up() {
|
||||||
if args.remote_access { start_micro_servers(); }
|
if args.remote_access { start_micro_servers(); }
|
||||||
gen_signing_keys();
|
gen_signing_keys();
|
||||||
if !is_using_remote_node() { monero::start_daemon(); }
|
if !is_using_remote_node() { monero::start_daemon(); }
|
||||||
|
create_wallet_dir();
|
||||||
// wait for daemon for a bit
|
// wait for daemon for a bit
|
||||||
tokio::time::sleep(std::time::Duration::new(5, 0)).await;
|
tokio::time::sleep(std::time::Duration::new(5, 0)).await;
|
||||||
monero::start_rpc();
|
monero::start_rpc();
|
||||||
|
|
Loading…
Reference in a new issue