Never run statistics when mempool not in sync.

This commit is contained in:
softsimon 2021-01-06 03:09:31 +07:00
parent 9e1ef1b747
commit 29dd6e5d8d
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -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<void> {
if (!memPool.isInSync()) {
return;
}
const currentMempool = memPool.getMempool();
const txPerSecond = memPool.getTxPerSecond();
const vBytesPerSecond = memPool.getVBytesPerSecond();