[health api] replace space with _ | only add esplora if enabled
This commit is contained in:
parent
8a51f32e63
commit
3c23e3ff84
@ -136,8 +136,6 @@ class BitcoinRoutes {
|
||||
// Bitcoin Core
|
||||
const bitcoinCoreBlockHeight = await bitcoinCoreApi.$getBlockHeightTip();
|
||||
const bitcoinCoreIndexes = await bitcoinClient.getIndexInfo();
|
||||
// Esplora
|
||||
const esploraBlockHeight = await bitcoinApi.$getBlockHeightTip();
|
||||
// Mempool
|
||||
const mempoolBlockHeight = blocks.getCurrentBlockHeight();
|
||||
const indexedBlockCount = await BlocksRepository.$getIndexedBlockCount();
|
||||
@ -148,9 +146,6 @@ class BitcoinRoutes {
|
||||
core: {
|
||||
height: bitcoinCoreBlockHeight,
|
||||
},
|
||||
esplora: {
|
||||
height: esploraBlockHeight
|
||||
},
|
||||
mempool: {
|
||||
height: mempoolBlockHeight,
|
||||
indexing: {
|
||||
@ -163,7 +158,14 @@ class BitcoinRoutes {
|
||||
|
||||
// Bitcoin Core indexes
|
||||
for (const indexName in bitcoinCoreIndexes) {
|
||||
response.core[indexName] = bitcoinCoreIndexes[indexName];
|
||||
response.core[indexName.replace(/ /g,'_')] = bitcoinCoreIndexes[indexName];
|
||||
}
|
||||
|
||||
if (config.MEMPOOL.BACKEND === 'esplora') {
|
||||
const esploraBlockHeight = await bitcoinApi.$getBlockHeightTip();
|
||||
response['esplora'] = {
|
||||
height: esploraBlockHeight
|
||||
};
|
||||
}
|
||||
|
||||
res.json(response);
|
||||
|
Loading…
x
Reference in New Issue
Block a user