From 8bb7272bb1006f3f62f82ba238fa995fcd89d80a Mon Sep 17 00:00:00 2001 From: Phi Date: Mon, 27 Mar 2023 10:04:15 +0200 Subject: [PATCH] Initialize with same length as partition Initialize the postParam.Partitions slice with the same length as i.Partitions before iterating over it in the loop. --- cmd/lotus-miner/proving.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/lotus-miner/proving.go b/cmd/lotus-miner/proving.go index d58ed1250..3ecc58ba7 100644 --- a/cmd/lotus-miner/proving.go +++ b/cmd/lotus-miner/proving.go @@ -658,6 +658,10 @@ It will not send any messages to the chain.`, for _, i := range res { var postParam SubmitWindowedPoStParams postParam.Deadline = i.Deadline + + // Initialize the postParam.Partitions slice with the same length as i.Partitions + postParam.Partitions = make([]PoStPartition, len(i.Partitions)) + for id, part := range i.Partitions { postParam.Partitions[id].Index = part.Index count, err := part.Skipped.Count()