Skip to main content

mine_block

Function mine_block 

Source
pub fn mine_block(
    block: Block,
    max_attempts: u64,
) -> Result<(Block, MiningResult), ConsensusError>
Expand description

MineBlock: ℬ × ℕ → ℬ × {success, failure}

Attempt to mine a block by finding a valid nonce:

  1. Try different nonce values
  2. Check if resulting hash meets difficulty target
  3. Return mined block or failure