Skip to content
Snippets Groups Projects
Commit 3f5bb49a authored by Éloïs's avatar Éloïs
Browse files

wip

parent ebf042c9
Branches
Tags
No related merge requests found
...@@ -152,19 +152,16 @@ pub fn get_block_in_local_blockchain<DB: BcDbInReadTx>( ...@@ -152,19 +152,16 @@ pub fn get_block_in_local_blockchain<DB: BcDbInReadTx>(
} }
/// Get block in local blockchain /// Get block in local blockchain
#[inline]
pub fn get_db_block_in_local_blockchain<DB: BcDbInReadTx>( pub fn get_db_block_in_local_blockchain<DB: BcDbInReadTx>(
db: &DB, db: &DB,
block_number: BlockNumber, block_number: BlockNumber,
) -> Result<Option<BlockDb>, DbError> { ) -> Result<Option<BlockDb>, DbError> {
if let Some(v) = db db.db()
.db()
.get_int_store(MAIN_BLOCKS) .get_int_store(MAIN_BLOCKS)
.get(db.r(), block_number.0)? .get(db.r(), block_number.0)?
{ .map(from_db_value)
Ok(Some(from_db_value(v)?)) .transpose()
} else {
Ok(None)
}
} }
/// Get several blocks in local blockchain /// Get several blocks in local blockchain
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment