Function zebra_state::service::read::block::any_utxo

source ·
pub fn any_utxo(
    non_finalized_state: NonFinalizedState,
    db: &ZebraDb,
    outpoint: OutPoint,
) -> Option<Utxo>
Expand description

Returns the Utxo for transparent::OutPoint, if it exists in any chain in the non_finalized_state, or in the 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 one or more non-finalized chains, but this function returns them without checking for non-finalized spends, because we don’t know which non-finalized chain the request belongs to.

UTXO spends are checked once the block reaches the non-finalized state, by check::utxo::transparent_spend().