Skip to content

Commit

Permalink
max links
Browse files Browse the repository at this point in the history
  • Loading branch information
anjor committed Sep 2, 2024
1 parent 097b9a8 commit 3c18bb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd-car-split.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3c18bb6

Please sign in to comment.