Refactoring the MINFEE node configuration into new configs.

This commit is contained in:
softsimon 2021-09-19 02:40:16 +04:00
parent aa39bbd091
commit 0d67bc36ee
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
4 changed files with 6 additions and 6 deletions

View File

@ -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",

View File

@ -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()

View File

@ -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',

View File

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