From 0536991233783f0de38d99244ad4227b71e38e59 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 26 Jan 2021 16:01:26 +0100 Subject: [PATCH] Allow DNS failures in checks --- packages/phishing/src/addrcheck.spec.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/phishing/src/addrcheck.spec.ts b/packages/phishing/src/addrcheck.spec.ts index 3e9cb1c62..8761fb276 100644 --- a/packages/phishing/src/addrcheck.spec.ts +++ b/packages/phishing/src/addrcheck.spec.ts @@ -34,14 +34,18 @@ async function checkGetWallet (ours: Record, site: string): Pr const found: string[] = []; for (let i = 0; i < 25; i++) { - const result = await (await fetch(`https://${site}/get_wallet.php`)).json() as Record; + try { + const result = await (await fetch(`https://${site}/get_wallet.php`)).json() as Record; - if (result && result.wallet) { - const wallet = result.wallet.replace('\r', ''); + if (result && result.wallet) { + const wallet = result.wallet.replace('\r', ''); - if (!found.includes(wallet)) { - found.push(wallet); + if (!found.includes(wallet)) { + found.push(wallet); + } } + } catch (error) { + // ignore } await delayLoop();