Function zebra_chain::block::arbitrary::fix_generated_transaction

source ·
pub fn fix_generated_transaction<F, E>(
    transaction: Transaction,
    tx_index_in_block: usize,
    height: Height,
    chain_value_pools: &mut ValueBalance<NonNegative>,
    utxos: &mut HashMap<OutPoint, OrderedUtxo>,
    check_transparent_coinbase_spend: F,
) -> Option<Transaction>
where F: Fn(OutPoint, CoinbaseSpendRestriction, &Utxo) -> Result<(), E> + Copy + 'static,
Expand description

Fix transaction so it obeys more consensus rules.

Spends transparent::OutPoints from utxos, and adds newly created outputs.

If the transaction can’t be fixed, returns None.