mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-02-03 11:46:42 +00:00
fix find_block
This commit is contained in:
parent
47fb1a2d4a
commit
19117bbef3
1 changed files with 8 additions and 6 deletions
|
@ -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 table_alt_block_heights = env_inner.open_db_ro::<AltBlockHeights>(&tx_ro)?;
|
||||||
|
|
||||||
let height = table_alt_block_heights.get(&block_hash)?;
|
match table_alt_block_heights.get(&block_hash) {
|
||||||
|
Ok(height) => Ok(BlockchainResponse::FindBlock(Some((
|
||||||
Ok(BlockchainResponse::FindBlock(Some((
|
Chain::Alt(height.chain_id.into()),
|
||||||
Chain::Alt(height.chain_id.into()),
|
height.height,
|
||||||
height.height,
|
)))),
|
||||||
))))
|
Err(RuntimeError::KeyNotFound) => Ok(BlockchainResponse::FindBlock(None)),
|
||||||
|
Err(e) => Err(e),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`BlockchainReadRequest::FilterUnknownHashes`].
|
/// [`BlockchainReadRequest::FilterUnknownHashes`].
|
||||||
|
|
Loading…
Reference in a new issue