Skip to main content

TrustedCanonicalization

Struct TrustedCanonicalization 

Source
pub struct TrustedCanonicalization { /* private fields */ }
Expand description

Single-pass canonical view of the wallet’s tx graph with trust verdicts pre-computed.

Built via one TxGraph::list_ordered_canonical_txs call which yields txs in topological (parents-before-children) order. We mark each tx trusted/untrusted in that order, so by the time we look at a tx every ancestor is already decided — no recursion, no per-tx Wallet::get_tx, no ancestor-walk budget heuristic.

In the same pass we also collect this wallet’s UTXOs (ours-outpoints from the keychain index, minus anything consumed by another canonical tx). TrustedCanonicalization::list_unspent returns them without triggering a second canonicalization the way Wallet::list_unspent would.

Implementations§

Source§

impl TrustedCanonicalization

Source

pub fn from_wallet(w: &Wallet, min_confs: u32) -> Self

Take one canonicalization snapshot of w and decide trust for every canonical tx using min_confs as the confirmation threshold.

Source

pub fn is_trusted(&self, txid: Txid) -> bool

Trust verdict for txid. Unknown txids (not in the wallet’s canonical view) are treated as untrusted.

Source

pub fn list_unspent(&self) -> impl Iterator<Item = TrustedUtxo<'_>> + '_

Iterate this wallet’s unspent outputs in canonical view, each carrying its trust verdict.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V