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
impl TrustedCanonicalization
Sourcepub fn from_wallet(w: &Wallet, min_confs: u32) -> Self
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.
Sourcepub fn is_trusted(&self, txid: Txid) -> bool
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.
Sourcepub fn list_unspent(&self) -> impl Iterator<Item = TrustedUtxo<'_>> + '_
pub fn list_unspent(&self) -> impl Iterator<Item = TrustedUtxo<'_>> + '_
Iterate this wallet’s unspent outputs in canonical view, each carrying its trust verdict.