From 1e4988780e450a47af151dd18417ff4bece5594e Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Tue, 12 Mar 2024 18:36:20 +0900 Subject: [PATCH] Fix previous hashes fetching --- leader/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/leader/src/lib.rs b/leader/src/lib.rs index 00919a3..cffb0e9 100644 --- a/leader/src/lib.rs +++ b/leader/src/lib.rs @@ -125,6 +125,9 @@ pub async fn get_block_hashes(block_number: U64, provider: &Provider) -> R .hash .unwrap(); for i in 1..=256 { + if block_number < i.into() { + break; + } let hash = provider .get_block(block_number - i) .await?