storagefsm: Fix batch deal packing behavior

This commit is contained in:
Łukasz Magiera
2021-05-30 17:46:22 +02:00
parent 3ea39f76e1
commit c8d603557b
5 changed files with 106 additions and 77 deletions
+3 -3
View File
@@ -244,13 +244,13 @@ func (sm *StorageMinerAPI) SectorsList(context.Context) ([]abi.SectorNumber, err
return nil, err
}
out := make([]abi.SectorNumber, len(sectors))
for i, sector := range sectors {
out := make([]abi.SectorNumber, 0, len(sectors))
for _, sector := range sectors {
if sector.State == sealing.UndefinedSectorState {
continue // sector ID not set yet
}
out[i] = sector.SectorNumber
out = append(out, sector.SectorNumber)
}
return out, nil
}