Skip to content

Commit

Permalink
Update zebra-network/src/config.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Arya <aryasolhi@gmail.com>
  • Loading branch information
upbqdn and arya2 committed May 17, 2024
1 parent dc11a5f commit d51ac59
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions zebra-network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,16 +768,11 @@ impl<'de> Deserialize<'de> for Config {
}

if let Some(target_difficulty_limit) = target_difficulty_limit {
params_builder = params_builder.with_target_difficulty_limit(U256::from(
<[u8; 32]>::try_from(
hex::decode(target_difficulty_limit).map_err(de::Error::custom)?,
)
.map_err(|err| {
de::Error::custom(format!(
"hex-encoded target difficulty must be 64 chars: {err:?}"
))
})?,
));
params_builder = params_builder.with_target_difficulty_limit(
target_difficulty_limit
.parse::<U256>()
.map_err(de::Error::custom)?,
);
}

if let Some(disable_pow) = disable_pow {
Expand Down

0 comments on commit d51ac59

Please sign in to comment.