Skip to content

Commit

Permalink
Merge pull request #1499 from 0chain/hotfix/stream-encrypt
Browse files Browse the repository at this point in the history
fix shard size for streaming encrypted files
  • Loading branch information
dabasov authored May 21, 2024
2 parents 6c2de9f + 1b28bab commit 9cf4952
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zboxcore/sdk/chunked_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,9 @@ func (su *ChunkedUpload) processCommit() error {

// getShardSize will return the size of data of a file each blobber is getting.
func getShardSize(dataSize int64, dataShards int, isEncrypted bool) int64 {
if dataSize == 0 {
return 0
}
chunkSize := int64(DefaultChunkSize)
if isEncrypted {
chunkSize -= (EncryptedDataPaddingSize + EncryptionHeaderSize)
Expand Down

0 comments on commit 9cf4952

Please sign in to comment.