From ddb242c9695a2d1e891b0f3d48cec8b4ef4f6c76 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 19 Dec 2016 17:41:55 +0100 Subject: [PATCH] Fixed upgrading keys on the first run --- ethcore/res/ethereum/tests | 2 +- parity/upgrade.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index e8f4624b7..9028c4801 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit e8f4624b7f1a15c63674eecf577c7ab76c3b16be +Subproject commit 9028c4801fd39fbb71a9796979182549a24e81c8 diff --git a/parity/upgrade.rs b/parity/upgrade.rs index 94d0adfe4..2963c3d05 100644 --- a/parity/upgrade.rs +++ b/parity/upgrade.rs @@ -139,9 +139,7 @@ fn file_exists(path: &Path) -> bool { } pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) { - let mut parent = to.clone(); - parent.pop(); - match fs::create_dir_all(&parent).and_then(|()| fs::read_dir(from)) { + match fs::create_dir_all(&to).and_then(|()| fs::read_dir(from)) { Ok(entries) => { let files: Vec<_> = entries.filter_map(|f| f.ok().and_then(|f| if f.file_type().ok().map_or(false, |f| f.is_file()) { f.file_name().to_str().map(|s| s.to_owned()) } else { None })).collect(); let mut num: usize = 0; @@ -165,7 +163,7 @@ pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) { } }, Err(e) => { - warn!("Error moving keys from {:?} to {:?}: {:?}", from, to, e); + debug!("Error moving keys from {:?} to {:?}: {:?}", from, to, e); } } }