From 60f0ff8e9e6302296d6c1b331a750c85917b79c0 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 16 Jan 2016 18:46:23 +0100 Subject: [PATCH] Fix bug. --- src/ethereum/ethash.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ethereum/ethash.rs b/src/ethereum/ethash.rs index 750b8297c..01508353c 100644 --- a/src/ethereum/ethash.rs +++ b/src/ethereum/ethash.rs @@ -22,12 +22,12 @@ impl Ethash { } fn u64_param(&self, name: &str) -> u64 { - *self.u64_params.write().unwrap().entry("name".to_string()).or_insert_with(|| + *self.u64_params.write().unwrap().entry(name.to_string()).or_insert_with(|| self.spec().engine_params.get(name).map(|a| decode(&a)).unwrap_or(0u64)) } fn u256_param(&self, name: &str) -> U256 { - *self.u256_params.write().unwrap().entry("name".to_string()).or_insert_with(|| + *self.u256_params.write().unwrap().entry(name.to_string()).or_insert_with(|| self.spec().engine_params.get(name).map(|a| decode(&a)).unwrap_or(x!(0))) } } @@ -132,7 +132,6 @@ impl Ethash { let difficulty_bound_divisor = self.u256_param("difficultyBoundDivisor"); let duration_limit = self.u64_param("durationLimit"); let frontier_limit = self.u64_param("frontierCompatibilityModeLimit"); - info!("Frontier limit: {}", frontier_limit); let mut target = if header.number < frontier_limit { if header.timestamp >= parent.timestamp + duration_limit { parent.difficulty - (parent.difficulty / difficulty_bound_divisor)