[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
|
// Bitcoin Core
|
||||||
const bitcoinCoreBlockHeight = await bitcoinCoreApi.$getBlockHeightTip();
|
const bitcoinCoreBlockHeight = await bitcoinCoreApi.$getBlockHeightTip();
|
||||||
const bitcoinCoreIndexes = await bitcoinClient.getIndexInfo();
|
const bitcoinCoreIndexes = await bitcoinClient.getIndexInfo();
|
||||||
// Esplora
|
|
||||||
const esploraBlockHeight = await bitcoinApi.$getBlockHeightTip();
|
|
||||||
// Mempool
|
// Mempool
|
||||||
const mempoolBlockHeight = blocks.getCurrentBlockHeight();
|
const mempoolBlockHeight = blocks.getCurrentBlockHeight();
|
||||||
const indexedBlockCount = await BlocksRepository.$getIndexedBlockCount();
|
const indexedBlockCount = await BlocksRepository.$getIndexedBlockCount();
|
||||||
@ -148,9 +146,6 @@ class BitcoinRoutes {
|
|||||||
core: {
|
core: {
|
||||||
height: bitcoinCoreBlockHeight,
|
height: bitcoinCoreBlockHeight,
|
||||||
},
|
},
|
||||||
esplora: {
|
|
||||||
height: esploraBlockHeight
|
|
||||||
},
|
|
||||||
mempool: {
|
mempool: {
|
||||||
height: mempoolBlockHeight,
|
height: mempoolBlockHeight,
|
||||||
indexing: {
|
indexing: {
|
||||||
@ -163,7 +158,14 @@ class BitcoinRoutes {
|
|||||||
|
|
||||||
// Bitcoin Core indexes
|
// Bitcoin Core indexes
|
||||||
for (const indexName in bitcoinCoreIndexes) {
|
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);
|
res.json(response);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user