Function zebra_state::service::read::block::utxo

source ·
pub fn utxo<C>(
    chain: Option<C>,
    db: &ZebraDb,
    outpoint: OutPoint,
) -> Option<Utxo>
where C: AsRef<Chain>,
Expand description

Returns the Utxo for transparent::OutPoint, if it exists in the non-finalized chain or finalized db.

Non-finalized UTXOs are returned regardless of whether they have been spent.

Finalized UTXOs are only returned if they are unspent in the finalized chain. They may have been spent in the non-finalized chain, but this function returns them without checking for non-finalized spends, because we don’t know which non-finalized chain will be committed to the finalized state.