Skip to content

Commit

Permalink
do not return err
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyonur committed Sep 9, 2024
1 parent fb21285 commit 477c3eb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions snow/uptime/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package uptime

import (
"errors"
"time"

"github.com/ava-labs/avalanchego/database"
Expand All @@ -14,11 +13,6 @@ import (

var _ Manager = (*manager)(nil)

var (
errAlreadyStartedTracking = errors.New("already started tracking")
errNotStartedTracking = errors.New("not started tracking")
)

type Manager interface {
Tracker
Calculator
Expand Down Expand Up @@ -62,7 +56,7 @@ func NewManager(state State, clk *mockable.Clock) Manager {

func (m *manager) StartTracking(nodeIDs []ids.NodeID) error {
if m.startedTracking {
return errAlreadyStartedTracking
return nil
}
now := m.clock.UnixTime()
for _, nodeID := range nodeIDs {
Expand All @@ -87,7 +81,7 @@ func (m *manager) StartTracking(nodeIDs []ids.NodeID) error {

func (m *manager) StopTracking(nodeIDs []ids.NodeID) error {
if !m.startedTracking {
return errNotStartedTracking
return nil
}
defer func() {
m.startedTracking = false
Expand Down

0 comments on commit 477c3eb

Please sign in to comment.