Skip to main content

pop_block

Function pop_block 

Source
pub fn pop_block(
    db: &BlockchainDatabase,
    move_to_alt_chain: Option<ChainId>,
    tx_rw: &mut OwnedWriteBatch,
    tapes: &mut TapesTruncateTransaction<'_>,
) -> DbResult<(BlockHeight, BlockHash, Block)>
Expand description

Remove the top/latest block from the database.

The removed block’s data is returned.

If a [ChainId] is specified the popped block will be added to the alt block tables under that [ChainId]. Otherwise, the block will be completely removed from the DB.