check for existence of deprecated ethash file before attempting delete (#2103)
This commit is contained in:
parent
c16bf7face
commit
f8f39c4369
@ -141,8 +141,11 @@ impl Light {
|
||||
if self.block_number >= ETHASH_EPOCH_LENGTH * 2 {
|
||||
let deprecated = Light::file_path(
|
||||
seed_compute.get_seedhash(self.block_number - ETHASH_EPOCH_LENGTH * 2));
|
||||
debug!(target: "ethash", "removing: {:?}", &deprecated);
|
||||
try!(fs::remove_file(deprecated));
|
||||
|
||||
if deprecated.exists() {
|
||||
debug!(target: "ethash", "removing: {:?}", &deprecated);
|
||||
try!(fs::remove_file(deprecated));
|
||||
}
|
||||
}
|
||||
|
||||
try!(fs::create_dir_all(path.parent().unwrap()));
|
||||
|
Loading…
Reference in New Issue
Block a user