From 8395b5f0f4d7609d574da650a0b66bdda79e0829 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal Date: Fri, 28 Aug 2020 20:58:07 +0200 Subject: [PATCH] When geometric mean of a new block is compared to that of the network, it must be accepted if it is equal, due to the number being rounded. `geo_mean = sqrt(achieved_difficulty_01 ^ 2 x achieved_difficulty_02 ^ 2)` --- base_layer/core/src/validation/accum_difficulty_validators.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_layer/core/src/validation/accum_difficulty_validators.rs b/base_layer/core/src/validation/accum_difficulty_validators.rs index 96eece0046..1bcdcc0b85 100644 --- a/base_layer/core/src/validation/accum_difficulty_validators.rs +++ b/base_layer/core/src/validation/accum_difficulty_validators.rs @@ -35,7 +35,7 @@ impl Validation for AccumDifficultyValidato let tip_header = db .fetch_last_header()? .ok_or_else(|| ValidationError::custom_error("Cannot retrieve tip header. Blockchain DB is empty"))?; - if *accum_difficulty <= tip_header.total_accumulated_difficulty_inclusive() { + if *accum_difficulty < tip_header.total_accumulated_difficulty_inclusive() { return Err(ValidationError::WeakerAccumulatedDifficulty); } Ok(())