actually call finalizeSector
This commit is contained in:
parent
4ce9d005dd
commit
c4e9a77be4
2
fsm.go
2
fsm.go
@ -155,7 +155,7 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta
|
||||
case api.CommitWait:
|
||||
return m.handleCommitWait, nil
|
||||
case api.FinalizeSector:
|
||||
|
||||
return m.handleFinalizeSector, nil
|
||||
case api.Proving:
|
||||
// TODO: track sector health / expiration
|
||||
log.Infof("Proving sector %d", state.SectorID)
|
||||
|
@ -233,8 +233,14 @@ 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.sb.FinalizeSector(ctx.Context(), sector.SectorID); err != nil {
|
||||
return ctx.Send(SectorCommitFailed{err})
|
||||
return ctx.Send(SectorCommitFailed{xerrors.Errorf("finalize sector: %w", err)})
|
||||
}
|
||||
|
||||
if err := m.sb.DropStaged(ctx.Context(), sector.SectorID); err != nil {
|
||||
return ctx.Send(SectorCommitFailed{xerrors.Errorf("drop staged: %w", err)})
|
||||
}
|
||||
|
||||
return ctx.Send(SectorFinalized{})
|
||||
|
Loading…
Reference in New Issue
Block a user