Make clear protection timeout configurable.

fixes #335
This commit is contained in:
softsimon
2021-02-14 20:32:00 +07:00
parent 2641ae0c8e
commit 7489d3360a
3 changed files with 6 additions and 4 deletions

View File

@@ -10,7 +10,6 @@ import loadingIndicators from './loading-indicators';
class Mempool {
private static WEBSOCKET_REFRESH_RATE_MS = 10000;
private static CLEAR_PROTECTION_MINUTES = 10;
private inSync: boolean = false;
private mempoolCache: { [txId: string]: TransactionExtended } = {};
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0,
@@ -143,7 +142,7 @@ class Mempool {
setTimeout(() => {
this.mempoolProtection = 2;
logger.warn('Mempool clear protection resumed.');
}, 1000 * 60 * Mempool.CLEAR_PROTECTION_MINUTES);
}, 1000 * 60 * config.MEMPOOL.CLEAR_PROTECTION_MINUTES);
}
let newMempool = {};