cuprate_consensus_rules::blocks

Function check_block

Source
pub fn check_block(
    block: &Block,
    total_fees: u64,
    block_weight: usize,
    block_blob_len: usize,
    block_chain_ctx: &ContextToVerifyBlock,
) -> Result<(HardFork, u64), BlockError>
Expand description

Checks the block is valid returning the blocks hard-fork VOTE and the amount of coins generated in this block.

This does not check the POW nor does it calculate the POW hash, this is because checking POW is very expensive and to allow the computation of the POW hashes to be done separately. This also does not check the transactions in the block are valid.

Missed block checks in this function:

https://monero-book.cuprate.org/consensus_rules/blocks.html#key-images https://monero-book.cuprate.org/consensus_rules/blocks.html#checking-pow-hash