From b6e9357a32b1800ec035a6cda488ce0ac6c200b0 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 9 Nov 2018 10:20:15 +0000 Subject: [PATCH] fix: use .cid property before falling back to .multihash DAGLinks have a `.cid` property, use that instead of `.multihash`. From the comment above the line it looks like this was the original intention but for whatever reason it was still using `.multihash`. --- src/resolver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolver.js b/src/resolver.js index 8f57ca7..a638048 100644 --- a/src/resolver.js +++ b/src/resolver.js @@ -86,7 +86,7 @@ const cid = promisify((ipfs, path, callback) => { try { // assume a Buffer with a valid CID // (cid is allowed instead of multihash since https://github.com/ipld/js-ipld-dag-pb/pull/80) - cidOfNextFile = new CID(link.multihash) + cidOfNextFile = new CID(link.cid) } catch (err) { // fallback to multihash cidOfNextFile = new CID(mh.toB58String(link.multihash))