Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed May 14, 2024
1 parent 62c5573 commit 079dc04
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/coreiface/options/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
}
} else {
if options.CidVersion < 0 {
// Default to CIDv0
options.CidVersion = 0
// Defaults to CIDv0 unless RawLeaves is set to true.
if options.RawLeavesSet && options.RawLeaves {
options.CidVersion = 1
} else {
options.CidVersion = 0
}
}
}

Expand Down

0 comments on commit 079dc04

Please sign in to comment.