pub fn create_new_block(
utxo_set: &UtxoSet,
mempool_txs: &[Transaction],
height: Natural,
prev_header: &BlockHeader,
prev_headers: &[BlockHeader],
coinbase_script: &ByteString,
coinbase_address: &ByteString,
) -> Result<Block>Expand description
CreateNewBlock: 𝒰𝒮 × 𝒯𝒳* → ℬ
For UTXO set us and mempool transactions txs:
- Create coinbase transaction with appropriate subsidy
- Select transactions from mempool based on fee rate
- Calculate merkle root
- Create block header with appropriate difficulty
- Return new block