From 6c33b1ae1efb7602336c4dca2195ec88b67af7c6 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 21 Feb 2023 20:25:54 -0800 Subject: [PATCH] block number instead of hash during health check --- web3_proxy/src/rpcs/one.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web3_proxy/src/rpcs/one.rs b/web3_proxy/src/rpcs/one.rs index 1fc80ea4..4cb4e6c3 100644 --- a/web3_proxy/src/rpcs/one.rs +++ b/web3_proxy/src/rpcs/one.rs @@ -707,13 +707,13 @@ impl Web3Rpc { // TODO: move this into a function and the chaining should be easier let head_block = conn.head_block.read().clone(); - if let Some((block_hash, txid)) = head_block.and_then(|x| { + if let Some((block_number, txid)) = head_block.and_then(|x| { let block = x.block.clone(); - let block_hash = block.hash?; + let block_number = block.number?; let txid = block.transactions.last().cloned()?; - Some((block_hash, txid)) + Some((block_number, txid)) }) { let to = conn .wait_for_query::<_, Option>( @@ -755,7 +755,7 @@ impl Web3Rpc { Ok(to) => { conn.wait_for_query::<_, Option>( "eth_getCode", - &(to, block_hash), + &(to, block_number), revert_handler, authorization.clone(), Some(client),