Browse Source

miner: Add unrecognized miners to the table

refactor
Hampus Sjöberg 4 years ago
parent
commit
c44aa8792f
  1. 11
      frontend/pages/miners.tsx

11
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);

Loading…
Cancel
Save