Merge pull request #7336 from filecoin-project/fix/dealcheck-panic

fix a panic in HandleRecoverDealIDs
This commit is contained in:
Łukasz Magiera 2021-09-16 12:06:58 +02:00 committed by GitHub
commit 45dc9697bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) 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 { 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) 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 continue