Module blocks

Source

Structs§

ContextToVerifyBlock
This struct contains the data needed to verify a block, implementers MUST make sure the data in this struct is calculated correctly.

Enums§

BlockError

Constants§

PENALTY_FREE_ZONE_1
PENALTY_FREE_ZONE_2
PENALTY_FREE_ZONE_5
RX_SEEDHASH_EPOCH_BLOCKS
RX_SEEDHASH_EPOCH_LAG

Traits§

RandomX
A trait to represent the RandomX VM.

Functions§

calculate_pow_hash
Calculates the POW hash of this block.
check_block
Checks the block is valid returning the blocks hard-fork VOTE and the amount of coins generated in this block.
check_block_pow
Returns if the blocks POW hash is valid for the current difficulty.
check_block_weight
Sanity check on the block weight.
check_timestamp
Checks the blocks timestamp is in the valid range.
is_randomx_seed_height
Returns if this height is a RandomX seed height.
penalty_free_zone
Returns the penalty free zone
randomx_seed_height
Returns the RandomX seed height for this block.