From f8f39c43691e8616881fddf206c751144325ceb1 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Fri, 16 Sep 2016 08:57:38 +0200 Subject: [PATCH] check for existence of deprecated ethash file before attempting delete (#2103) --- ethash/src/compute.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ethash/src/compute.rs b/ethash/src/compute.rs index 8354651cc..a99a0e3b5 100644 --- a/ethash/src/compute.rs +++ b/ethash/src/compute.rs @@ -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()));