Set in sync to false when mempool clear protection is active.

refs #76
This commit is contained in:
softsimon 2020-06-18 14:34:56 +07:00
parent 6688421e39
commit b92eef8198
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 1 additions and 4 deletions

View File

@ -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;

View File

@ -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[] = [];