cuprate_blockchain::ops::tx

Function get_num_tx

Source
pub fn get_num_tx(
    table_tx_ids: &impl DatabaseRo<TxIds>,
) -> Result<u64, RuntimeError>
Expand description

How many Transactions are there?

This returns the amount of transactions currently stored.

For example:

  • 0 transactions exist => returns 0
  • 1 transactions exist => returns 1
  • 5 transactions exist => returns 5
  • etc

§Errors

This function returns RuntimeError::KeyNotFound if the input (if applicable) doesn’t exist or other RuntimeError’s on database errors.