Skip to content

Commit

Permalink
When geometric mean of a new block is compared to that of the network…
Browse files Browse the repository at this point in the history
…, 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)`
  • Loading branch information
hansieodendaal committed Aug 28, 2020
1 parent 2e415c8 commit 8395b5f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<B: BlockchainBackend> Validation<Difficulty, B> 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(())
Expand Down

0 comments on commit 8395b5f

Please sign in to comment.