From 3c18bb6a8f6a5477b981b1266e72547573354bd1 Mon Sep 17 00:00:00 2001 From: anjor Date: Mon, 2 Sep 2024 15:59:00 +0100 Subject: [PATCH] max links --- cmd-car-split.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)