pub struct WalletCoinSpendResult {
pub spend: Option<WalletCoinSpend>,
pub source: Option<WalletReadSource>,
pub synced: bool,
pub peak_height: Option<u32>,
}Expand description
control.wallet.coinSpend — the spend that spent one coin, named by that coin’s id.
§spend: null is an ANSWER with TWO honest causes; an unreachable chain is an ERROR
null means a chain WAS consulted and no spend of that coin exists there — either because the
coin is UNSPENT, or because the chain holds no such coin at all. Both are legitimately “there is
no spend”, and the contract deliberately does not distinguish them here: a caller that needs to
tell them apart asks WalletCoinByIdResult, whose coin: null separates the two.
What null NEVER means is that the node could not answer. That is a catalogued error
(WalletNoChainSource /
WalletReadFailed /
WalletRateLimited). The three-valued
distinction is money-critical: a caller following a singleton forward reads “no spend” as this
is the current tip and stops walking. Collapsing “could not answer” into it makes a stale coin
look like the tip, and a spend built against a superseded singleton is invalid.
§A negative answer requires a view that could have held the spend
spend: null is a VERDICT, and the same rule WalletCoinByIdResult states applies unchanged: a
node whose replica is still catching up, or whose index is address-scoped rather than a full
chain view, has established only that IT cannot see the spend. Such a node MUST return
WalletNoChainSource / WalletReadFailed and MUST NOT answer null.
Fields§
§spend: Option<WalletCoinSpend>The spend, or null when the consulted chain holds no spend of that coin (see the type docs).
The key MUST be present. null is a verdict here, so an ABSENT key must not decode into one —
the same reason WalletCoinByIdResult::coin is required.
source: Option<WalletReadSource>Which tier answered, or None from a node too old to disclose it. See WalletReadSource.
synced: boolWhether this answer reflects a caught-up view of the tier that ANSWERED, measured against that tier’s own peak — never against the node’s replica or its held peers.
true only when that peak came from the SAME read that produced these figures; a carried-over
peak means false.
peak_height: Option<u32>The peak height of the tier that ANSWERED, or null when that tier tracks no peak.
It MUST be the height that tier reported in the SAME read that produced the figures, or null.
Trait Implementations§
Source§impl Clone for WalletCoinSpendResult
impl Clone for WalletCoinSpendResult
Source§fn clone(&self) -> WalletCoinSpendResult
fn clone(&self) -> WalletCoinSpendResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more