From 9082c19f319835842343fc30f0ce7356b3580742 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:59:02 -0400 Subject: [PATCH] feat: use in memory state for header_td (#10189) --- .../storage/provider/src/providers/blockchain_provider.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/storage/provider/src/providers/blockchain_provider.rs b/crates/storage/provider/src/providers/blockchain_provider.rs index 54e6a57ec3..7d16a02f29 100644 --- a/crates/storage/provider/src/providers/blockchain_provider.rs +++ b/crates/storage/provider/src/providers/blockchain_provider.rs @@ -194,7 +194,11 @@ where } fn header_td(&self, hash: &BlockHash) -> ProviderResult> { - self.database.header_td(hash) + if let Some(num) = self.block_number(*hash)? { + self.header_td_by_number(num) + } else { + Ok(None) + } } fn header_td_by_number(&self, number: BlockNumber) -> ProviderResult> {