* handle keys deserialization errors, fixes #1592 * warning on unsuccesfull geth accounts import
This commit is contained in:
@@ -73,13 +73,14 @@ impl DiskDirectory {
|
||||
|
||||
let files = try!(files);
|
||||
|
||||
let accounts = files.into_iter()
|
||||
files.into_iter()
|
||||
.map(json::KeyFile::load)
|
||||
.zip(paths.into_iter())
|
||||
.filter_map(|(file, path)| file.ok().map(|file| (path.clone(), SafeAccount::from_file(file, path))))
|
||||
.collect();
|
||||
|
||||
Ok(accounts)
|
||||
.map(|(file, path)| match file {
|
||||
Ok(file) => Ok((path, file.into())),
|
||||
Err(err) => Err(Error::InvalidKeyFile(format!("{:?}: {}", path, err))),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user