From b92eef8198ad374af04741dd8bcbe265c9769303 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 18 Jun 2020 14:34:56 +0700 Subject: [PATCH] Set in sync to false when mempool clear protection is active. refs #76 --- backend/src/api/mempool.ts | 1 + backend/src/api/statistics.ts | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/src/api/mempool.ts b/backend/src/api/mempool.ts index 45f521046..d847eb048 100644 --- a/backend/src/api/mempool.ts +++ b/backend/src/api/mempool.ts @@ -127,6 +127,7 @@ class Mempool { // Prevent mempool from clear on bitcoind restart by delaying the deletion if (this.mempoolProtection === 0 && transactions.length < currentMempoolSize / 2) { this.mempoolProtection = 1; + this.inSync = false; console.log('Mempool clear protection triggered.'); setTimeout(() => { this.mempoolProtection = 2; diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index fcbb050ad..6e5eb8119 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -37,10 +37,6 @@ class Statistics { const txPerSecond = memPool.getTxPerSecond(); const vBytesPerSecond = memPool.getVBytesPerSecond(); - if (txPerSecond === 0) { - return; - } - console.log('Running statistics'); let memPoolArray: TransactionExtended[] = [];