From b920e17f24016caf01e321b124f05bea7fcd51d5 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 11 Nov 2025 23:18:37 +0000 Subject: [PATCH] Do not report error in `getPeers` before it has happened --- cmd/yggdrasilctl/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/yggdrasilctl/main.go b/cmd/yggdrasilctl/main.go index 51c25dcd..3bbdf6ab 100644 --- a/cmd/yggdrasilctl/main.go +++ b/cmd/yggdrasilctl/main.go @@ -190,7 +190,9 @@ func run() int { for _, peer := range resp.Peers { state, lasterr, dir, rtt, rxr, txr := "Up", "-", "Out", "-", "-", "-" if !peer.Up { - state, lasterr = "Down", fmt.Sprintf("%s ago: %s", peer.LastErrorTime.Round(time.Second), peer.LastError) + if state = "Down"; peer.LastError != "" { + lasterr = fmt.Sprintf("%s ago: %s", peer.LastErrorTime.Round(time.Second), peer.LastError) + } } else if rttms := float64(peer.Latency.Microseconds()) / 1000; rttms > 0 { rtt = fmt.Sprintf("%.02fms", rttms) }