diff --git a/cmd-car-split.go b/cmd-car-split.go index 30c16cf8..665886ab 100644 --- a/cmd-car-split.go +++ b/cmd-car-split.go @@ -34,6 +34,8 @@ import ( var CBOR_SHA256_DUMMY_CID = cid.MustParse("bafyreics5uul5lbtxslcigtoa5fkba7qgwu7cyb7ih7z6fzsh4lgfgraau") +const maxLinks = 432000 / 18 // 18 subsets + type subsetInfo struct { fileName string firstSlot int @@ -236,7 +238,7 @@ func newCmd_SplitCar() *cli.Command { dagSize += owm.RawSectionSize() } - if currentFile == nil || currentFileSize+int64(dagSize) > maxFileSize { + if currentFile == nil || currentFileSize+int64(dagSize) > maxFileSize || len(currentSubsetInfo.blockLinks) > maxLinks { err := createNewFile() if err != nil { return fmt.Errorf("failed to create a new file: %w", err)