Remember cached ENS if it's now null

This commit is contained in:
Marco van Dijk 2023-11-03 03:46:30 +01:00
parent b2ae0eeee5
commit 4720e88b46

View File

@ -104,8 +104,12 @@ const getEnsDomain = async function (addr) {
const ensDomain = await l1provider.lookupAddress(address);
let ensObj;
if (!ensDomain) {
let domain = null;
if (cached){
domain = cached.domain;
}
ensObj = {
domain: null,
domain: domain,
address: addr,
timestamp: now,
};
@ -129,7 +133,7 @@ const getEnsDomain = async function (addr) {
} catch (err) {
console.log(err);
console.log("Error looking up ENS info, retrying...");
await sleep(50);
await sleep(200);
return null;
}
};