Function zebra_consensus::block::check::difficulty_is_valid

source ยท
pub fn difficulty_is_valid(
    header: &Header,
    network: &Network,
    height: &Height,
    hash: &Hash,
) -> Result<(), BlockError>
Expand description

Returns Ok(()) if hash passes:

  • the target difficulty limit for network (PoWLimit), and
  • the difficulty filter,

based on the fields in header.

If the block is invalid, returns an error containing height and hash.