cuprate_blockchain::ops::alt_block

Function add_alt_block

Source
pub fn add_alt_block(
    alt_block: &AltBlockInformation,
    tables: &mut impl TablesMut,
) -> Result<(), RuntimeError>
Expand description

Add a AltBlockInformation to the database.

This extracts all the data from the input block and maps/adds them to the appropriate database tables.

§Errors

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

§Panics

This function will panic if:

  • alt_block.height is == 0
  • alt_block.txs.len() != alt_block.block.transactions.len()