diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index 72e5d28ae..6ff103bf1 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -12,7 +12,8 @@ "BLOCK_WEIGHT_UNITS": 4000000, "INITIAL_BLOCKS_AMOUNT": 8, "MEMPOOL_BLOCKS_AMOUNT": 8, - "PRICE_FEED_UPDATE_INTERVAL": 3600 + "PRICE_FEED_UPDATE_INTERVAL": 3600, + "USE_SECOND_NODE_FOR_MINFEE": false }, "CORE_RPC": { "HOST": "127.0.0.1", @@ -29,7 +30,6 @@ "REST_API_URL": "http://127.0.0.1:3000" }, "SECOND_CORE_RPC": { - "ENABLED": false, "HOST": "127.0.0.1", "PORT": 8332, "USERNAME": "mempool", diff --git a/backend/src/api/mempool.ts b/backend/src/api/mempool.ts index e6bd13abb..4d6c35860 100644 --- a/backend/src/api/mempool.ts +++ b/backend/src/api/mempool.ts @@ -208,7 +208,7 @@ class Mempool { } private $getMempoolInfo() { - if (config.SECOND_CORE_RPC.ENABLED) { + if (config.MEMPOOL.USE_SECOND_NODE_FOR_MINFEE) { return Promise.all([ bitcoinClient.getMempoolInfo(), bitcoinSecondClient.getMempoolInfo() diff --git a/backend/src/config.ts b/backend/src/config.ts index 47d38492d..2addc176a 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -15,6 +15,7 @@ interface IConfig { INITIAL_BLOCKS_AMOUNT: number; MEMPOOL_BLOCKS_AMOUNT: number; PRICE_FEED_UPDATE_INTERVAL: number; + USE_SECOND_NODE_FOR_MINFEE: boolean; }; ESPLORA: { REST_API_URL: string; @@ -31,7 +32,6 @@ interface IConfig { PASSWORD: string; }; SECOND_CORE_RPC: { - ENABLED: boolean; HOST: string; PORT: number; USERNAME: string; @@ -77,6 +77,7 @@ const defaults: IConfig = { 'INITIAL_BLOCKS_AMOUNT': 8, 'MEMPOOL_BLOCKS_AMOUNT': 8, 'PRICE_FEED_UPDATE_INTERVAL': 3600, + 'USE_SECOND_NODE_FOR_MINFEE': false, }, 'ESPLORA': { 'REST_API_URL': 'http://127.0.0.1:3000', @@ -93,7 +94,6 @@ const defaults: IConfig = { 'PASSWORD': 'mempool' }, 'SECOND_CORE_RPC': { - 'ENABLED': false, 'HOST': '127.0.0.1', 'PORT': 8332, 'USERNAME': 'mempool', diff --git a/backend/src/index.ts b/backend/src/index.ts index a07903a7b..cfca7cc65 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -113,7 +113,7 @@ class Server { await memPool.$updateMemPoolInfo(); } catch (e) { const msg = `updateMempoolInfo: ${(e instanceof Error ? e.message : e)}`; - if (config.SECOND_CORE_RPC.ENABLED) { + if (config.MEMPOOL.USE_SECOND_NODE_FOR_MINFEE) { logger.warn(msg); } else { logger.debug(msg);