fix: sealing pipeline: Allow nil message in TerminateWait

This commit is contained in:
Łukasz Magiera 2023-04-19 15:43:50 +02:00
parent a7379e2cce
commit 4bdb6b34b3

View File

@ -81,7 +81,12 @@ func (m *Sealing) handleTerminating(ctx statemachine.Context, sector SectorInfo)
func (m *Sealing) handleTerminateWait(ctx statemachine.Context, sector SectorInfo) error {
if sector.TerminateMessage == nil {
return xerrors.New("entered TerminateWait with nil TerminateMessage")
ts, err := m.Api.ChainHead(ctx.Context())
if err != nil {
return ctx.Send(SectorTerminateFailed{xerrors.Errorf("getting chain head: %w", err)})
}
return ctx.Send(SectorTerminated{TerminatedAt: ts.Height()})
}
mw, err := m.Api.StateWaitMsg(ctx.Context(), *sector.TerminateMessage, build.MessageConfidence, api.LookbackNoLimit, true)