From e2d045cda83df91544fe341fa387d46514b787f6 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 6 Jan 2021 03:09:31 +0700 Subject: [PATCH] Never run statistics when mempool not in sync. --- backend/src/api/statistics.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 2681933ee..619331b77 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -25,15 +25,15 @@ class Statistics { setTimeout(() => { this.runStatistics(); this.intervalTimer = setInterval(() => { - if (!memPool.isInSync()) { - return; - } this.runStatistics(); }, 1 * 60 * 1000); }, difference); } private async runStatistics(): Promise { + if (!memPool.isInSync()) { + return; + } const currentMempool = memPool.getMempool(); const txPerSecond = memPool.getTxPerSecond(); const vBytesPerSecond = memPool.getVBytesPerSecond();