From c44aa8792f19e9f87142a19a9b403133653ac9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20Sj=C3=B6berg?= Date: Thu, 29 Apr 2021 16:09:42 +0200 Subject: [PATCH] miner: Add unrecognized miners to the table --- frontend/pages/miners.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/pages/miners.tsx b/frontend/pages/miners.tsx index ee3091f..a60dff6 100644 --- a/frontend/pages/miners.tsx +++ b/frontend/pages/miners.tsx @@ -83,20 +83,21 @@ export default function Miners() { blocksReversed.reverse(); const miners = blocksReversed.reduce((prev, currBlock) => { - if (!currBlock.miner) { + if (currBlock.signals === undefined) { return prev; } - if (!prev[currBlock.miner]) { - prev[currBlock.miner] = { - name: currBlock.miner, + const key = currBlock.miner ?? "unknown"; + if (!prev[key]) { + prev[key] = { + name: currBlock.miner ?? "Unrecognized miners", signals: currBlock.signals ?? false, website: currBlock.minerWebsite, numBlocks: 1, }; return prev; } - prev[currBlock.miner].numBlocks++; + prev[key].numBlocks++; return prev; }, {} as IMinerData);