Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

parity: print correct keys path on startup #9501

Merged
merged 2 commits into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
cmd.dirs.create_dirs(cmd.acc_conf.unlocked_accounts.len() == 0, cmd.secretstore_conf.enabled)?;

//print out running parity environment
print_running_environment(&spec.name, &cmd.dirs, &db_dirs);
print_running_environment(&spec.data_dir, &cmd.dirs, &db_dirs);

info!("Running in experimental {} mode.", Colour::Blue.bold().paint("Light Client"));

Expand Down Expand Up @@ -402,7 +402,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
}

//print out running parity environment
print_running_environment(&spec.name, &cmd.dirs, &db_dirs);
print_running_environment(&spec.data_dir, &cmd.dirs, &db_dirs);

// display info about used pruning algorithm
info!("State DB configuration: {}{}{}",
Expand Down Expand Up @@ -926,9 +926,9 @@ fn daemonize(_pid_file: String) -> Result<(), String> {
Err("daemon is no supported on windows".into())
}

fn print_running_environment(spec_name: &String, dirs: &Directories, db_dirs: &DatabaseDirectories) {
fn print_running_environment(data_dir: &str, dirs: &Directories, db_dirs: &DatabaseDirectories) {
info!("Starting {}", Colour::White.bold().paint(version()));
info!("Keys path {}", Colour::White.bold().paint(dirs.keys_path(spec_name).to_string_lossy().into_owned()));
info!("Keys path {}", Colour::White.bold().paint(dirs.keys_path(data_dir).to_string_lossy().into_owned()));
info!("DB path {}", Colour::White.bold().paint(db_dirs.db_root_path().to_string_lossy().into_owned()));
}

Expand Down
4 changes: 2 additions & 2 deletions util/dir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ impl Directories {
}

/// Get the keys path
pub fn keys_path(&self, spec_name: &str) -> PathBuf {
pub fn keys_path(&self, data_dir: &str) -> PathBuf {
let mut dir = PathBuf::from(&self.keys);
dir.push(spec_name);
dir.push(data_dir);
dir
}
}
Expand Down