Skip to main content

UtxoSet

Type Alias UtxoSet 

Source
pub type UtxoSet = HashMap<OutPoint, Arc<UTXO>, FxBuildHasher>;
Expand description

UTXO Set: 𝒰𝒮 = 𝒪 → 𝒰

Arc avoids ~1500+ clones/block during IBD supplement_utxo_map and apply_sync_batch. In production builds, uses FxHashMap for 2-3x faster lookups in large UTXO sets.

Aliased Type§

pub struct UtxoSet { /* private fields */ }

Trait Implementations§

Source§

impl UtxoLookup for UtxoSet

Available on crate feature production only.

Implementation for standard UtxoSet (HashMap / FxHashMap).

Source§

fn get(&self, outpoint: &OutPoint) -> Option<&UTXO>

Look up a UTXO by outpoint.
Source§

fn contains_key(&self, outpoint: &OutPoint) -> bool

Check if a UTXO exists.
Source§

fn len(&self) -> usize

Get the number of UTXOs (approximate for overlays).
Source§

fn is_empty(&self) -> bool

Check if empty.