pub fn chain_height(
table_block_heights: &impl DatabaseRo<BlockHeights>,
) -> DbResult<BlockHeight>Expand description
Retrieve the height of the chain.
This returns the chain-tip, not the top_block_height.
For example:
- The blockchain has 0 blocks => this returns
0 - The blockchain has 1 block (height 0) => this returns
1 - The blockchain has 2 blocks (height 1) => this returns
2
So the height of a new block would be chain_height().
§Errors
This function returns cuprate_database::RuntimeError::KeyNotFound if the input (if applicable) doesn’t exist or other RuntimeError’s on database errors.