diff --git a/states_sealing.go b/states_sealing.go index 8043902d8..113105162 100644 --- a/states_sealing.go +++ b/states_sealing.go @@ -356,7 +356,7 @@ func (m *Sealing) handleCommitWait(ctx statemachine.Context, sector SectorInfo) func (m *Sealing) handleFinalizeSector(ctx statemachine.Context, sector SectorInfo) error { // TODO: Maybe wait for some finality - if err := m.sealer.FinalizeSector(sector.sealingCtx(ctx.Context()), m.minerSector(sector.SectorNumber), sector.unsealedRanges(false)); err != nil { + if err := m.sealer.FinalizeSector(sector.sealingCtx(ctx.Context()), m.minerSector(sector.SectorNumber), sector.keepUnsealedRanges(false)); err != nil { return ctx.Send(SectorFinalizeFailed{xerrors.Errorf("finalize sector: %w", err)}) } @@ -367,7 +367,7 @@ func (m *Sealing) handleProvingSector(ctx statemachine.Context, sector SectorInf // TODO: track sector health / expiration log.Infof("Proving sector %d", sector.SectorNumber) - if err := m.sealer.ReleaseUnsealed(ctx.Context(), m.minerSector(sector.SectorNumber), sector.unsealedRanges(true)); err != nil { + if err := m.sealer.ReleaseUnsealed(ctx.Context(), m.minerSector(sector.SectorNumber), sector.keepUnsealedRanges(true)); err != nil { log.Error(err) } diff --git a/types.go b/types.go index 6c8bd38eb..255c93a55 100644 --- a/types.go +++ b/types.go @@ -142,7 +142,9 @@ func (t *SectorInfo) sealingCtx(ctx context.Context) context.Context { return ctx } -func (t *SectorInfo) unsealedRanges(invert bool) []storage.Range { +// Returns list of offset/length tuples of sector data ranges which clients +// requested to keep unsealed +func (t *SectorInfo) keepUnsealedRanges(invert bool) []storage.Range { var out []storage.Range var at abi.UnpaddedPieceSize