fix find_block
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled

This commit is contained in:
Boog900 2024-09-15 19:42:48 +01:00
parent 47fb1a2d4a
commit 19117bbef3
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2

View file

@ -231,12 +231,14 @@ fn find_block(env: &ConcreteEnv, block_hash: BlockHash) -> ResponseResult {
let table_alt_block_heights = env_inner.open_db_ro::<AltBlockHeights>(&tx_ro)?;
let height = table_alt_block_heights.get(&block_hash)?;
Ok(BlockchainResponse::FindBlock(Some((
match table_alt_block_heights.get(&block_hash) {
Ok(height) => Ok(BlockchainResponse::FindBlock(Some((
Chain::Alt(height.chain_id.into()),
height.height,
))))
)))),
Err(RuntimeError::KeyNotFound) => Ok(BlockchainResponse::FindBlock(None)),
Err(e) => Err(e),
}
}
/// [`BlockchainReadRequest::FilterUnknownHashes`].