Skip to content

Commit

Permalink
Merge pull request #7135 from filecoin-project/fix/addpiece-errval
Browse files Browse the repository at this point in the history
Fix error handling in SectorAddPieceToAny api impl
  • Loading branch information
magik6k authored Aug 19, 2021
2 parents 28bf968 + 0beb48f commit fcc3103
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ func (sm *StorageMinerAPI) SectorsStatus(ctx context.Context, sid abi.SectorNumb
}

func (sm *StorageMinerAPI) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r sto.Data, d api.PieceDealInfo) (api.SectorOffset, error) {
return sm.Miner.SectorAddPieceToAny(ctx, size, r, d)
so, err := sm.Miner.SectorAddPieceToAny(ctx, size, r, d)
if err != nil {
// jsonrpc doesn't support returning values with errors, make sure we never do that
return api.SectorOffset{}, err
}

return so, nil
}

func (sm *StorageMinerAPI) SectorsUnsealPiece(ctx context.Context, sector sto.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error {
Expand Down

0 comments on commit fcc3103

Please sign in to comment.