diff --git a/web3_proxy/src/rpcs/one.rs b/web3_proxy/src/rpcs/one.rs index 5ec2bfac..4ae71d53 100644 --- a/web3_proxy/src/rpcs/one.rs +++ b/web3_proxy/src/rpcs/one.rs @@ -995,16 +995,25 @@ impl Web3Rpc { .await?; } Ok(Some(block)) => { - // don't send repeat blocks - let new_hash = - block.hash.expect("blocks here should always have hashes"); + if let Some(new_hash) = block.hash { + // don't send repeat blocks + if new_hash != last_hash { + // new hash! + last_hash = new_hash; - if new_hash != last_hash { - // new hash! - last_hash = new_hash; + self.send_head_block_result( + Ok(Some(block)), + &block_sender, + block_map.clone(), + ) + .await?; + } + } else { + // TODO: why is this happening? + warn!("empty head block on {}", self); self.send_head_block_result( - Ok(Some(block)), + Ok(None), &block_sender, block_map.clone(), )