From 5aefc71c4976f442d5779e7971b91d289fd6e558 Mon Sep 17 00:00:00 2001 From: moralpriest Date: Thu, 9 Jul 2026 02:50:21 -0600 Subject: [PATCH] refactor(walletapi): remove redundant test_connectivity from Notify_broadcaster The Notify_broadcaster function received a goroutine that called test_connectivity() on every Height notification. This is redundant because receiving the notification itself already proves the daemon connection is alive. The timer.Reset call at the top of the function already serves as the liveness signal by keeping Keep_Connectivity from issuing unnecessary ping checks. Removing this goroutine reduces overhead on every block notification and eliminates a potential race where test_connectivity could briefly set Connected=false if the daemon is slow to respond to the Echo/GetInfo calls that follow the Height notification. --- walletapi/daemon_communication.go | 1 - 1 file changed, 1 deletion(-) diff --git a/walletapi/daemon_communication.go b/walletapi/daemon_communication.go index 2cffea05..72b47ca5 100644 --- a/walletapi/daemon_communication.go +++ b/walletapi/daemon_communication.go @@ -109,7 +109,6 @@ func Notify_broadcaster(req *jrpc2.Request) { NotifyHeightChange.L.Lock() NotifyHeightChange.Broadcast() NotifyHeightChange.L.Unlock() - go test_connectivity() case "MiniBlock": // we can skip this default: logger.V(1).Info("Notification received", "method", req.Method())