Kaynağa Gözat

control/controlclient: remove unused reference to mapCtx (#17614)

Updates #cleanup

Signed-off-by: James Sanderson <[email protected]>
James 'zofrex' Sanderson 4 ay önce
ebeveyn
işleme
b6c6960e40
2 değiştirilmiş dosya ile 7 ekleme ve 2 silme
  1. 1 2
      control/controlclient/auto.go
  2. 6 0
      util/backoff/backoff.go

+ 1 - 2
control/controlclient/auto.go

@@ -433,7 +433,6 @@ func (mrs mapRoutineState) UpdateFullNetmap(nm *netmap.NetworkMap) {
 	c := mrs.c
 
 	c.mu.Lock()
-	ctx := c.mapCtx
 	c.inMapPoll = true
 	if c.loggedIn {
 		c.state = StateSynchronized
@@ -447,7 +446,7 @@ func (mrs mapRoutineState) UpdateFullNetmap(nm *netmap.NetworkMap) {
 		c.sendStatus("mapRoutine-got-netmap", nil, "", nm)
 	}
 	// Reset the backoff timer if we got a netmap.
-	mrs.bo.BackOff(ctx, nil)
+	mrs.bo.Reset()
 }
 
 func (mrs mapRoutineState) UpdateNetmapDelta(muts []netmap.NodeMutation) bool {

+ 6 - 0
util/backoff/backoff.go

@@ -78,3 +78,9 @@ func (b *Backoff) BackOff(ctx context.Context, err error) {
 	case <-tChannel:
 	}
 }
+
+// Reset resets the backoff schedule, equivalent to calling BackOff with a nil
+// error.
+func (b *Backoff) Reset() {
+	b.n = 0
+}