Do not allocate pieces that are bigger than a sector
This commit is contained in:
parent
379a4655b0
commit
5ad33896cc
@ -90,6 +90,10 @@ func (m *Sealing) AllocatePiece(size abi.UnpaddedPieceSize) (sectorID abi.Sector
|
||||
if (padreader.PaddedSize(uint64(size))) != size {
|
||||
return 0, 0, xerrors.Errorf("cannot allocate unpadded piece")
|
||||
}
|
||||
|
||||
if size > abi.UnpaddedPieceSize(m.sealer.SectorSize()) {
|
||||
return 0, 0, xerrors.Errorf("piece cannot fit into a sector")
|
||||
}
|
||||
|
||||
sid, err := m.sc.Next()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user