Sfoglia il codice sorgente

validator/pow: added fixed_difficulty greater than zero shield

aggstam 2 anni fa
parent
commit
7834a3f800
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      src/validator/pow.rs

+ 5 - 0
src/validator/pow.rs

@@ -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,