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.
This commit is contained in:
parent
3f8a41cfe8
commit
8bb7272bb1
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user