New backend config "NETWORK".

Only activate mempool protection.
Log network to
fixes #140
This commit is contained in:
softsimon
2020-10-15 11:07:53 +07:00
parent 372c116283
commit 86c654f22f
4 changed files with 8 additions and 5 deletions

View File

@@ -135,7 +135,8 @@ class Mempool {
}
// Prevent mempool from clear on bitcoind restart by delaying the deletion
if (this.mempoolProtection === 0 && transactions.length / currentMempoolSize <= 0.80) {
if ((config.NETWORK === 'mainnet' || !config.NETWORK)
&& this.mempoolProtection === 0 && transactions.length / currentMempoolSize <= 0.80) {
this.mempoolProtection = 1;
this.inSync = false;
logger.warn(`Mempool clear protection triggered because transactions.length: ${transactions.length} and currentMempoolSize: ${currentMempoolSize}.`);