From c7a1421ff39700b1968396700db2cb9972bdfac9 Mon Sep 17 00:00:00 2001 From: Dmitry Shihovtsev Date: Tue, 30 May 2023 09:51:29 +0600 Subject: [PATCH] Check all service types for monitoring status endpoint --- core/node/node_status_tracker.go | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/core/node/node_status_tracker.go b/core/node/node_status_tracker.go index c213c2ef63..3a0859b070 100644 --- a/core/node/node_status_tracker.go +++ b/core/node/node_status_tracker.go @@ -18,8 +18,6 @@ package node import ( - "github.com/mysteriumnetwork/node/core" - "github.com/mysteriumnetwork/node/identity" ) @@ -79,23 +77,11 @@ func (k *MonitoringStatusTracker) Status() MonitoringStatus { } func resolveMonitoringStatus(sessions []Session) MonitoringStatus { - wgSession, ok := findWireGuard(sessions) - if !ok { - return Pending - } - - if wgSession.MonitoringFailed { - return Failed - } - return Passed -} - -// openvpn is considered deprecated -func findWireGuard(sessions []Session) (Session, bool) { for _, s := range sessions { - if s.ServiceType == core.WireGuard.String() { - return s, true + if s.MonitoringFailed { + return Failed } } - return Session{}, false + + return Passed }