diff --git a/web3_proxy/src/rpcs/consensus.rs b/web3_proxy/src/rpcs/consensus.rs index 96866ca8..613e259a 100644 --- a/web3_proxy/src/rpcs/consensus.rs +++ b/web3_proxy/src/rpcs/consensus.rs @@ -436,22 +436,18 @@ impl RankedRpcs { // TODO: refs for all of these. borrow on a Sender is cheap enough // TODO: move this to many.rs impl Web3Rpcs { + #[inline] pub fn head_block(&self) -> Option { self.watch_head_block .as_ref() .and_then(|x| x.borrow().clone()) } - /// note: you probably want to use `head_block` instead - /// TODO: return a ref? - pub fn head_block_hash(&self) -> Option { - self.head_block().map(|x| *x.hash()) - } - - /// note: you probably want to use `head_block` instead - /// TODO: return a ref? + #[inline] pub fn head_block_num(&self) -> Option { - self.head_block().map(|x| x.number()) + self.watch_head_block + .as_ref() + .and_then(|x| x.borrow().as_ref().map(|x| x.number())) } pub fn synced(&self) -> bool {