From 118880b6f7c4f2676710b607e9199e3d10018903 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 20 Apr 2023 15:59:07 +0200 Subject: [PATCH] Send a status notification on offline peers change (#821) Sum offline peers too --- client/internal/peer/status.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/internal/peer/status.go b/client/internal/peer/status.go index 508131816..2b311ff09 100644 --- a/client/internal/peer/status.go +++ b/client/internal/peer/status.go @@ -78,6 +78,7 @@ func (d *Status) ReplaceOfflinePeers(replacement []State) { defer d.mux.Unlock() d.offlinePeers = make([]State, len(replacement)) copy(d.offlinePeers, replacement) + d.notifyPeerListChanged() } // AddPeer adds peer to Daemon status map @@ -308,7 +309,7 @@ func (d *Status) onConnectionChanged() { } func (d *Status) notifyPeerListChanged() { - d.notifier.peerListChanged(len(d.peers)) + d.notifier.peerListChanged(len(d.peers) + len(d.offlinePeers)) } func (d *Status) notifyAddressChanged() {