From b63687795d8e0ae7565f6563f6b0c3eaeccaa887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9E=97=E6=AC=A3?= Date: Mon, 16 Nov 2020 17:51:02 +0800 Subject: [PATCH 1/2] break loop when found warm up sector --- miner/warmup.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miner/warmup.go b/miner/warmup.go index d0b8c5b35..5340675b2 100644 --- a/miner/warmup.go +++ b/miner/warmup.go @@ -24,6 +24,7 @@ func (m *Miner) winPoStWarmup(ctx context.Context) error { var sector abi.SectorNumber = math.MaxUint64 + out: for dlIdx := range deadlines { partitions, err := m.api.StateMinerPartitions(ctx, m.address, uint64(dlIdx), types.EmptyTSK) if err != nil { @@ -40,6 +41,7 @@ func (m *Miner) winPoStWarmup(ctx context.Context) error { } sector = abi.SectorNumber(b) + break out } } From b92ce76a788ca1a57518d483d4f84e96d57bcc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 18 Nov 2020 02:03:52 +0100 Subject: [PATCH 2/2] gofmt --- miner/warmup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/warmup.go b/miner/warmup.go index 5340675b2..991679c09 100644 --- a/miner/warmup.go +++ b/miner/warmup.go @@ -24,7 +24,7 @@ func (m *Miner) winPoStWarmup(ctx context.Context) error { var sector abi.SectorNumber = math.MaxUint64 - out: +out: for dlIdx := range deadlines { partitions, err := m.api.StateMinerPartitions(ctx, m.address, uint64(dlIdx), types.EmptyTSK) if err != nil {