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

Commit

Permalink
check for existence of deprecated ethash file before attempting delete (
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier authored and arkpar committed Sep 16, 2016
1 parent c16bf7f commit f8f39c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ethash/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit f8f39c4

Please sign in to comment.