From 3b65074f38232ecee5b6851e4f477d526688a7e2 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 17 Jun 2023 11:33:33 -0700 Subject: [PATCH] cleaner duration multiplication --- web3_proxy/src/rpcs/many.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web3_proxy/src/rpcs/many.rs b/web3_proxy/src/rpcs/many.rs index 8ca269e3..21db4d8e 100644 --- a/web3_proxy/src/rpcs/many.rs +++ b/web3_proxy/src/rpcs/many.rs @@ -118,10 +118,8 @@ impl Web3Rpcs { let max_head_block_lag = max_head_block_lag.unwrap_or(5.into()); - let max_head_block_age = Duration::from_secs_f32( - (max_head_block_lag.as_u64() * 10) as f32 - * average_block_interval(chain_id).as_secs_f32(), - ); + let max_head_block_age = + average_block_interval(chain_id).mul_f32((max_head_block_lag.as_u64() * 10) as f32); let connections = Arc::new(Self { block_sender,