From aefb180fb435b54083a51a42d983495bc102fab9 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Sat, 17 Feb 2024 16:27:37 -0500 Subject: [PATCH] fix pool info --- src/ORM/_views/user-agent-report/user-agent-report.view.ts | 4 ++-- src/app.controller.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ORM/_views/user-agent-report/user-agent-report.view.ts b/src/ORM/_views/user-agent-report/user-agent-report.view.ts index c8fa5c1..8fc2dd9 100644 --- a/src/ORM/_views/user-agent-report/user-agent-report.view.ts +++ b/src/ORM/_views/user-agent-report/user-agent-report.view.ts @@ -19,9 +19,9 @@ export class UserAgentReportView { @ViewColumn() userAgent: string; @ViewColumn() - count: number; + count: string; @ViewColumn() bestDifficulty: number; @ViewColumn() - totalHashRate: number; + totalHashRate: string; } \ No newline at end of file diff --git a/src/app.controller.ts b/src/app.controller.ts index 919bfe1..ae7ca88 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -69,8 +69,8 @@ export class AppController { const userAgents = await this.userAgentReportService.getReport(); - const totalHashRate = userAgents.reduce((acc, userAgent) => acc + userAgent.totalHashRate, 0); - const totalMiners = userAgents.reduce((acc, userAgent) => acc + userAgent.count, 0); + const totalHashRate = userAgents.reduce((acc, userAgent) => acc + parseFloat(userAgent.totalHashRate), 0); + const totalMiners = userAgents.reduce((acc, userAgent) => acc + parseFloat(userAgent.count), 0); const blockHeight = (await firstValueFrom(this.bitcoinRpcService.newBlock$)).blocks; const blocksFound = await this.blocksService.getFoundBlocks();