From 314fae41feb26ab2986ab8b67c27a3ee48a82192 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 19 May 2020 09:51:43 +1000 Subject: [PATCH] Remove duplicate code (#1165) --- beacon_node/eth1/src/service.rs | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index a33096b26b..b3b1165bf4 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -581,36 +581,6 @@ impl Service { service.inner.block_cache.read().len() as i64, ); - let block_cache = service.inner.block_cache.read(); - let latest_block_mins = block_cache - .latest_block_timestamp() - .and_then(|timestamp| { - SystemTime::now() - .duration_since(UNIX_EPOCH) - .ok() - .and_then(|now| now.checked_sub(Duration::from_secs(timestamp))) - }) - .map(|duration| format!("{} mins", duration.as_secs() / 60)) - .unwrap_or_else(|| "n/a".into()); - - if blocks_imported > 0 { - info!( - service.log, - "Imported eth1 block(s)"; - "latest_block_age" => latest_block_mins, - "latest_block" => block_cache.highest_block_number(), - "total_cached_blocks" => block_cache.len(), - "new" => blocks_imported - ); - } else { - debug!( - service.log, - "No new eth1 blocks imported"; - "latest_block" => block_cache.highest_block_number(), - "cached_blocks" => block_cache.len(), - ); - } - let block_cache = service.inner.block_cache.read(); let latest_block_mins = block_cache .latest_block_timestamp()