// Fetches the best block hash from the provided metadata db.
Fetches the best block hash from the provided metadata db.
Fetches the best block hash from the provided metadata db .
fn fetch_best_block(env: &Environment, db: &Database) -> Result<Option<BlockHash>, ChainStorageError> {
    let k = MetadataKey::BestBlock;
    let val: Option<MetadataValue> = lmdb_get(&env, &db, &(k as u32))?;
    match val {
        Some(MetadataValue::BestBlock(best_block)) => Ok(best_block),
        _ => Ok(None),
    }
}
fn fetch_best_block ( env : & Environment , db : & Database ) -> Result < Option < BlockHash > , ChainStorageError > { let k = MetadataKey :: BestBlock ; let val : Option < MetadataValue > = lmdb_get ( & env , & db , & ( k as u32 ) ) ? ; match val { Some ( MetadataValue :: BestBlock ( best_block ) ) => Ok ( best_block ) , _ => Ok ( None ) , } }
Fetches the best block hash from the provided metadata db.
Fetches the best block hash from the provided metadata db .
env
&Environment
db
&Database