mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-24 11:36:10 +00:00
ops: add get_block_info()
This commit is contained in:
parent
a598fc38d2
commit
5d8322dcba
1 changed files with 10 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue