Skip to content
Snippets Groups Projects
Commit 0b31d02d authored by Jerome DESCHAMPS's avatar Jerome DESCHAMPS
Browse files

Added a minimum for network difficulty at one

parent f4b13acf
No related branches found
No related tags found
No related merge requests found
Pipeline #6700 passed
......@@ -19,6 +19,7 @@ const MAXIMUM_ITERATIONS: u64 = 800_000_000; //approximately one day
/// Compute the delay parameter in seconds of a VDF to run
pub fn compute_vdf_difficulty(network_difficulty: u64, hash: H256, quantity: U256) -> u64 {
let vdf_difficulty = U256::from(network_difficulty)
.max(U256::ONE)
.wrapping_mul(h256_to_u256(hash))
.as_u64()
% MAXIMUM_ITERATIONS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment