Merge pull request #6763 from filecoin-project/johnli-helloworld-fix/fsm-error
sealing: Handle preCommitParams errors more correctly
This commit is contained in:
commit
90c8891f95
12
extern/storage-sealing/states_sealing.go
vendored
12
extern/storage-sealing/states_sealing.go
vendored
@ -358,8 +358,11 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf
|
||||
}
|
||||
|
||||
params, pcd, tok, err := m.preCommitParams(ctx, sector)
|
||||
if params == nil || err != nil {
|
||||
return err
|
||||
if err != nil {
|
||||
return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("preCommitParams: %w", err)})
|
||||
}
|
||||
if params == nil {
|
||||
return nil // event was sent in preCommitParams
|
||||
}
|
||||
|
||||
deposit, err := collateralSendAmount(ctx.Context(), m.api, m.maddr, cfg, pcd)
|
||||
@ -403,9 +406,12 @@ func (m *Sealing) handleSubmitPreCommitBatch(ctx statemachine.Context, sector Se
|
||||
}
|
||||
|
||||
params, deposit, _, err := m.preCommitParams(ctx, sector)
|
||||
if params == nil || err != nil {
|
||||
if err != nil {
|
||||
return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("preCommitParams: %w", err)})
|
||||
}
|
||||
if params == nil {
|
||||
return nil // event was sent in preCommitParams
|
||||
}
|
||||
|
||||
res, err := m.precommiter.AddPreCommit(ctx.Context(), sector, deposit, params)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user