address nit
This commit is contained in:
parent
48feb52cbf
commit
ac77c51d5e
10
extern/sector-storage/ffiwrapper/sealer_cgo.go
vendored
10
extern/sector-storage/ffiwrapper/sealer_cgo.go
vendored
@ -212,6 +212,11 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
|
|||||||
return abi.PieceInfo{}, xerrors.Errorf("generate unsealed CID: %w", err)
|
return abi.PieceInfo{}, xerrors.Errorf("generate unsealed CID: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validate that the pieceCID was properly formed
|
||||||
|
if _, err := commcid.CIDToPieceCommitmentV1(pieceCID); err != nil {
|
||||||
|
return abi.PieceInfo{}, err
|
||||||
|
}
|
||||||
|
|
||||||
if payloadRoundedBytes < pieceSize.Padded() {
|
if payloadRoundedBytes < pieceSize.Padded() {
|
||||||
paddedCid, err := commpffi.ZeroPadPieceCommitment(pieceCID, payloadRoundedBytes.Unpadded(), pieceSize)
|
paddedCid, err := commpffi.ZeroPadPieceCommitment(pieceCID, payloadRoundedBytes.Unpadded(), pieceSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -221,11 +226,6 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
|
|||||||
pieceCID = paddedCid
|
pieceCID = paddedCid
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate that the pieceCID was properly formed
|
|
||||||
if _, err := commcid.CIDToPieceCommitmentV1(pieceCID); err != nil {
|
|
||||||
return abi.PieceInfo{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return abi.PieceInfo{
|
return abi.PieceInfo{
|
||||||
Size: pieceSize.Padded(),
|
Size: pieceSize.Padded(),
|
||||||
PieceCID: pieceCID,
|
PieceCID: pieceCID,
|
||||||
|
Loading…
Reference in New Issue
Block a user