Skip to content

Commit

Permalink
Merge pull request #7336 from filecoin-project/fix/dealcheck-panic
Browse files Browse the repository at this point in the history
fix a panic in HandleRecoverDealIDs
  • Loading branch information
magik6k authored Sep 16, 2021
2 parents e786a05 + 438d5ce commit 45dc969
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extern/storage-sealing/states_failed.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ func (m *Sealing) HandleRecoverDealIDs(ctx Context, sector SectorInfo) error {
failed[i] = xerrors.Errorf("getting current deal info for piece %d: %w", i, err)
}

if res.MarketDeal == nil {
failed[i] = xerrors.Errorf("nil market deal (%d,%d,%d,%s)", i, sector.SectorNumber, p.DealInfo.DealID, p.Piece.PieceCID)
continue
}

if res.MarketDeal.Proposal.PieceCID != p.Piece.PieceCID {
failed[i] = xerrors.Errorf("recovered piece (%d) deal in sector %d (dealid %d) has different PieceCID %s != %s", i, sector.SectorNumber, p.DealInfo.DealID, p.Piece.PieceCID, res.MarketDeal.Proposal.PieceCID)
continue
Expand Down

0 comments on commit 45dc969

Please sign in to comment.