Skip to main content

Module mining

Module mining 

Source

Structs§

BlockTemplate
BlockTemplate: Interface for mining software

Enums§

MiningResult
Result of mining attempt

Functions§

calculate_merkle_root
Calculate merkle root using proper Bitcoin Merkle tree construction
calculate_merkle_root_from_tx_ids
Build merkle tree from pre-computed leaf hashes.
compute_merkle_root_and_mutated
Compute merkle root and CVE-2012-2459 mutation flag without aborting on mutation. Matches Bitcoin Core’s ComputeMerkleRoot(leaves, &mutated) — always returns a root. Callers decide policy: CheckBlock rejects mutated blocks; ConnectBlock may skip the check for already-accepted blocks.
create_block_template
Create a block template for mining
create_new_block
CreateNewBlock: 𝒰𝒮 × 𝒯𝒳* → ℬ
create_new_block_with_time
CreateNewBlock variant that accepts an explicit block_time.
mine_block
MineBlock: ℬ × ℕ → ℬ × {success, failure}