diff --git a/miner/miner.go b/miner/miner.go index 144b2f413b7..3b1e65a72b2 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -149,9 +149,8 @@ func (m *Miner) mine(ctx context.Context) { defer span.End() var lastBase MiningBase - +minerLoop: for { - minerStop: select { case <-m.stop: stopping := m.stopping @@ -172,7 +171,7 @@ func (m *Miner) mine(ctx context.Context) { if err != nil { log.Errorf("failed to get best mining candidate: %s", err) if !m.niceSleep(time.Second * 5) { - goto minerStop + goto minerLoop } continue } @@ -204,7 +203,7 @@ func (m *Miner) mine(ctx context.Context) { if err != nil { log.Errorf("failed getting beacon entry: %s", err) if !m.niceSleep(time.Second) { - goto minerStop + goto minerLoop } continue } @@ -215,7 +214,7 @@ func (m *Miner) mine(ctx context.Context) { if base.TipSet.Equals(lastBase.TipSet) && lastBase.NullRounds == base.NullRounds { log.Warnf("BestMiningCandidate from the previous round: %s (nulls:%d)", lastBase.TipSet.Cids(), lastBase.NullRounds) if !m.niceSleep(time.Duration(build.BlockDelaySecs) * time.Second) { - goto minerStop + goto minerLoop } continue } @@ -226,7 +225,7 @@ func (m *Miner) mine(ctx context.Context) { if err != nil { log.Errorf("mining block failed: %+v", err) if !m.niceSleep(time.Second) { - goto minerStop + goto minerLoop } onDone(false, 0, err) continue