Skip to main content

batch_check_proof_of_work

Function batch_check_proof_of_work 

Source
pub fn batch_check_proof_of_work(
    headers: &[BlockHeader],
) -> Result<Vec<(bool, Option<[u8; 32]>)>, ConsensusError>
Expand description

Batch check proof of work for multiple headers

This function validates multiple block headers in batch, which is useful during initial block download or header synchronization. Headers are serialized and hashed in parallel when the production feature is enabled.

§Arguments

  • headers - Slice of block headers to validate

§Returns

Vector of tuples (is_valid, computed_hash) for each header. Hash is None for invalid headers. Order matches input headers.