Function zebra_chain::block::arbitrary::find_valid_utxo_for_spend

source ·
pub fn find_valid_utxo_for_spend<F, E>(
    transaction: &mut Transaction,
    spend_restriction: &mut CoinbaseSpendRestriction,
    spend_height: Height,
    utxos: &HashMap<OutPoint, OrderedUtxo>,
    check_transparent_coinbase_spend: F
) -> Option<OutPoint>
where F: Fn(OutPoint, CoinbaseSpendRestriction, &Utxo) -> Result<(), E> + Copy + 'static,
Expand description

Find a valid transparent::OutPoint in utxos to spend in transaction.

Modifies transaction and updates spend_restriction if needed.

If there is no valid output, or many search attempts have failed, returns None.