pub enum WalletSyncPhase {
NotStarted,
Syncing,
Synced,
}Expand description
How far the node’s wallet chain replica has got — the three states a background sync can be in.
Three named states rather than a boolean, because “has never started” and “is caught up” are
different facts and a bool can only carry one of them. Paired with a peak_height a boolean
forces a never-started wallet to report some height, and 0 is the only one available — which
reads as synced to the genesis block, a claim about the chain that is simply false.
Variants§
NotStarted
No sync has begun: the wallet holds no replica of the chain and is not building one.
Syncing
A sync is running — either the initial catch-up, or the ongoing task that keeps the replica
current. A wallet whose catch-up finished but whose peer connections have all dropped is
Syncing, not Synced: it is trying to be current and is not.
Synced
The initial catch-up completed AND at least one Chia peer connection is currently live: the replica is caught up and CONNECTED, so it is in a position to be kept current.
That is what the predicate delivers, and no more. A live connection to a stalled or lagging peer satisfies it while the replica quietly goes stale, so this phase MUST NOT be read as proof that the data is FRESH — only that nothing is known to be preventing freshness.
Implementations§
Source§impl WalletSyncPhase
impl WalletSyncPhase
Sourcepub const ALL: &'static [WalletSyncPhase]
pub const ALL: &'static [WalletSyncPhase]
Every phase, in progress order — the enumeration a machine reads, and the anchor the conformance KATs pin the wire tokens against.
Trait Implementations§
Source§impl Clone for WalletSyncPhase
impl Clone for WalletSyncPhase
Source§fn clone(&self) -> WalletSyncPhase
fn clone(&self) -> WalletSyncPhase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more