Show avg block heath in pool ranking pie chart

This commit is contained in:
nymkappa
2023-02-20 17:47:45 +09:00
parent e3e7271c9d
commit 0dc2a598c3
5 changed files with 23 additions and 2 deletions

View File

@@ -100,7 +100,7 @@ class Mining {
rank: rank++,
emptyBlocks: emptyBlocksCount.length > 0 ? emptyBlocksCount[0]['count'] : 0,
slug: poolInfo.slug,
avgMatchRate: Math.round(100 * poolInfo.avgMatchRate) / 100,
avgMatchRate: poolInfo.avgMatchRate !== null ? Math.round(100 * poolInfo.avgMatchRate) / 100 : null,
};
poolsStats.push(poolStat);
});

View File

@@ -16,7 +16,7 @@ export interface PoolInfo {
link: string;
blockCount: number;
slug: string;
avgMatchRate: number;
avgMatchRate: number | null;
}
export interface PoolStats extends PoolInfo {