1
0
forked from GRIN/grim

Build 11: node card tells 'can't reach node' apart from syncing

A flaky external node read as 'Syncing…' forever — the card now goes
red with 'Can't reach node' on wallet sync errors (wallet.sync_error())
and recovers on the next good cycle. Validated against a dead node and
back on a live one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-06-11 08:50:20 -04:00
parent 9d36562bab
commit 0c60368280
+20 -5
View File
@@ -525,7 +525,10 @@ impl GoblinWalletView {
.get_data()
.map(|d| d.info.last_confirmed_height)
.unwrap_or(0);
let synced = height > 0 && !wallet.syncing();
// Distinguish "scanning" from "can't reach the node": a flaky
// external node otherwise reads as syncing forever.
let error = wallet.sync_error();
let synced = height > 0 && !wallet.syncing() && !error;
w::card(ui, |ui| {
ui.set_min_width(ui.available_width());
ui.horizontal(|ui| {
@@ -533,14 +536,26 @@ impl GoblinWalletView {
ui.painter().circle_filled(
dot.center(),
4.0,
if synced { t.pos } else { t.accent },
if error {
t.neg
} else if synced {
t.pos
} else {
t.accent
},
);
ui.add_space(8.0);
ui.vertical(|ui| {
ui.label(
RichText::new(if synced { "Node synced" } else { "Syncing…" })
.font(FontId::new(14.0, fonts::semibold()))
.color(t.surface_text),
RichText::new(if error {
"Can't reach node"
} else if synced {
"Node synced"
} else {
"Syncing…"
})
.font(FontId::new(14.0, fonts::semibold()))
.color(t.surface_text),
);
// Single line: wrapping strands the "·" separator at the
// end of the first line in the narrow sidebar card.