*attempt to return the normal CID before manually finding its base

This commit is contained in:
Derrick Hammer 2023-04-01 12:57:14 -04:00
parent 3955ff2c29
commit 3ba792cd35
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -339,6 +339,10 @@ async function handleIpnsResolve(aq: ActiveQuery) {
}
function getCID(cid: string): CID {
try {
return CID.parse(cid);
} catch {}
const prefix = substr(cid, 0, 1);
if (!(prefix in basesByPrefix)) {