ops: add get_block_info()

This commit is contained in:
hinto.janai 2024-04-23 13:32:33 -04:00
parent a598fc38d2
commit 5d8322dcba
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -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<BlockInfos>,
) -> Result<BlockInfo, RuntimeError> {
table_block_infos.get(block_height)
}
/// Retrieve a [`BlockHeight`] via its [`BlockHash`].
#[doc = doc_error!()]
#[inline]