Add docstring to Sectorinfo.unsealedRanges
This commit is contained in:
parent
0503592af7
commit
ec9db30863
@ -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)
|
||||
}
|
||||
|
||||
|
4
types.go
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user