From ec6ef93b7b551105eaafad43430adad6e723628a Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 26 Nov 2020 12:06:15 +1000 Subject: [PATCH] Simplify an ExpandedDifficulty division --- zebra-state/src/service/check/difficulty.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zebra-state/src/service/check/difficulty.rs b/zebra-state/src/service/check/difficulty.rs index 74153b0e6..cc3fb5650 100644 --- a/zebra-state/src/service/check/difficulty.rs +++ b/zebra-state/src/service/check/difficulty.rs @@ -211,10 +211,9 @@ impl AdjustedDifficulty { .expect("difficulty thresholds in previously verified blocks are valid") }) .sum(); - let total: U256 = total.into(); - let divisor: U256 = POW_AVERAGING_WINDOW.into(); - (total / divisor).into() + let divisor: U256 = POW_AVERAGING_WINDOW.into(); + total / divisor } /// Calculate the bounded median timespan. The median timespan is the