From 5d8322dcba73f21ffeb3c89c56185ebc7f272571 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Tue, 23 Apr 2024 13:32:33 -0400 Subject: [PATCH] ops: add `get_block_info()` --- database/src/ops/block.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/database/src/ops/block.rs b/database/src/ops/block.rs index 8cfadc3f..bd3763e8 100644 --- a/database/src/ops/block.rs +++ b/database/src/ops/block.rs @@ -216,6 +216,16 @@ pub fn get_block_extended_header_top( } //---------------------------------------------------------------------------------------------------- Misc +/// Retrieve a [`BlockInfo`] via its [`BlockHeight`]. +#[doc = doc_error!()] +#[inline] +pub fn get_block_info( + block_height: &BlockHeight, + table_block_infos: &impl DatabaseRo, +) -> Result { + table_block_infos.get(block_height) +} + /// Retrieve a [`BlockHeight`] via its [`BlockHash`]. #[doc = doc_error!()] #[inline]