fix: sealing: Abort upgrades in sectors with no deals
This commit is contained in:
parent
4e830a8c31
commit
d2c726cd28
@ -21,6 +21,11 @@ import (
|
||||
)
|
||||
|
||||
func (m *Sealing) handleReplicaUpdate(ctx statemachine.Context, sector SectorInfo) error {
|
||||
// if the sector ended up not having any deals, abort the upgrade
|
||||
if !sector.hasDeals() {
|
||||
return ctx.Send(SectorAbortUpgrade{xerrors.New("sector had no deals")})
|
||||
}
|
||||
|
||||
if err := checkPieces(ctx.Context(), m.maddr, sector, m.Api, true); err != nil { // Sanity check state
|
||||
return handleErrors(ctx, err, sector)
|
||||
}
|
||||
|
@ -49,6 +49,11 @@ func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) err
|
||||
delete(m.assignedPieces, m.minerSectorID(sector.SectorNumber))
|
||||
m.inputLk.Unlock()
|
||||
|
||||
// if this is a snapdeals sector, but it ended up not having any deals, abort the upgrade
|
||||
if sector.State == SnapDealsPacking && !sector.hasDeals() {
|
||||
return ctx.Send(SectorAbortUpgrade{xerrors.New("sector had no deals")})
|
||||
}
|
||||
|
||||
log.Infow("performing filling up rest of the sector...", "sector", sector.SectorNumber)
|
||||
|
||||
var allocated abi.UnpaddedPieceSize
|
||||
|
Loading…
Reference in New Issue
Block a user