Skip to content

Commit

Permalink
Update packages/upload-client/src/sharding.js
Browse files Browse the repository at this point in the history
Co-authored-by: Irakli Gozalishvili <[email protected]>
  • Loading branch information
Alan Shaw and Gozala authored Sep 7, 2023
1 parent 6a1ebcf commit 786d873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/upload-client/src/sharding.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class ShardingStream extends TransformStream {

const rootCID = options.rootCID ?? rootBlock.cid
const headerLength = headerEncodingLength(rootCID)
// does the shard with the CAR header that _includes_ a root CID
// exceed the shard size?
// If adding CAR root overflows the shard limit we move overflowing blocks
// into a another CAR.
if (headerLength + shardBlockLength > shardSize) {
const overage = headerLength + shardBlockLength - shardSize
const lastShard = []
Expand Down

0 comments on commit 786d873

Please sign in to comment.