Skip to content

Commit

Permalink
validator/pow: added fixed_difficulty greater than zero shield
Browse files Browse the repository at this point in the history
  • Loading branch information
aggstam committed Nov 21, 2023
1 parent 61d2628 commit 7834a3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/validator/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ impl PoWModule {
cummulative_difficulty = difficulty.cummulative_difficulty;
}

// If a fixed difficulty has been set, assert its greater than zero
if let Some(diff) = &fixed_difficulty {
assert!(diff > &BigUint::zero());
}

Ok(Self {
threads,
target,
Expand Down

0 comments on commit 7834a3f

Please sign in to comment.