Module difficulty

Source
Expand description

Get context and calculate difficulty for the next block.

Constants§

EXTRA_TIME_TO_MINE_A_BLOCK
The amount of extra time we allow for a miner to mine a standard difficulty block on testnet.

Functions§

adjust_difficulty_and_time_for_testnet 🔒
Adjust the difficulty and time for the testnet minimum difficulty rule.
best_relevant_chain_and_history_tree 🔒
Do a consistency check by checking the finalized tip before and after all other database queries.
difficulty_time_and_history_tree 🔒
Returns the GetBlockTemplateChainInfo for the supplied relevant_chain, tip, network, and history_tree.
get_block_template_chain_info
Returns the GetBlockTemplateChainInfo for the current best chain.
solution_rate
Accepts a non_finalized_state, ZebraDb, num_blocks, and a block hash to start at.