Skip to content

Commit a799835

Browse files
committed
chore: pass block args
1 parent 5c9fa18 commit a799835

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/ipfs-unixfs-importer/src/utils/persist.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ const persist = async (buffer, block, options) => {
2828
const multihash = await mh(buffer, options.hashAlg)
2929
const cid = new CID(options.cidVersion, options.codec, multihash)
3030

31-
if (options.onlyHash) {
32-
return cid
31+
if (!options.onlyHash) {
32+
await block.put(buffer, {
33+
pin: options.pin,
34+
preload: options.preload,
35+
cid
36+
})
3337
}
3438

35-
await block.put(buffer, {
36-
pin: options.pin,
37-
preload: options.preload,
38-
cid
39-
})
40-
4139
return cid
4240
}
4341

0 commit comments

Comments
 (0)