Disable tomahawk status on non-official instances
This commit is contained in:
parent
1518b3ccfb
commit
5f3ca3a321
@ -344,16 +344,20 @@ class ElectrsApi implements AbstractBitcoinApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getHealthStatus(): HealthCheckHost[] {
|
public getHealthStatus(): HealthCheckHost[] {
|
||||||
return this.failoverRouter.sortHosts().map(host => ({
|
if (config.MEMPOOL.OFFICIAL) {
|
||||||
host: host.host,
|
return this.failoverRouter.sortHosts().map(host => ({
|
||||||
active: host === this.failoverRouter.activeHost,
|
host: host.host,
|
||||||
rtt: host.rtt,
|
active: host === this.failoverRouter.activeHost,
|
||||||
latestHeight: host.latestHeight || 0,
|
rtt: host.rtt,
|
||||||
socket: !!host.socket,
|
latestHeight: host.latestHeight || 0,
|
||||||
outOfSync: !!host.outOfSync,
|
socket: !!host.socket,
|
||||||
unreachable: !!host.unreachable,
|
outOfSync: !!host.outOfSync,
|
||||||
checked: !!host.checked,
|
unreachable: !!host.unreachable,
|
||||||
}));
|
checked: !!host.checked,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class WebsocketHandler {
|
|||||||
response['da'] = this.socketData['da'];
|
response['da'] = this.socketData['da'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantNow['want-tomahawk'] && config.MEMPOOL.BACKEND === 'esplora' && config.ESPLORA.FALLBACK?.length) {
|
if (wantNow['want-tomahawk']) {
|
||||||
response['tomahawk'] = JSON.stringify(bitcoinApi.getHealthStatus());
|
response['tomahawk'] = JSON.stringify(bitcoinApi.getHealthStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ class WebsocketHandler {
|
|||||||
response['mempool-blocks'] = getCachedResponse('mempool-blocks', mBlocks);
|
response['mempool-blocks'] = getCachedResponse('mempool-blocks', mBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client['want-tomahawk'] && config.MEMPOOL.BACKEND === 'esplora' && config.ESPLORA.FALLBACK?.length) {
|
if (client['want-tomahawk']) {
|
||||||
response['tomahawk'] = getCachedResponse('tomahawk', bitcoinApi.getHealthStatus());
|
response['tomahawk'] = getCachedResponse('tomahawk', bitcoinApi.getHealthStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -919,7 +919,7 @@ class WebsocketHandler {
|
|||||||
response['mempool-blocks'] = getCachedResponse('mempool-blocks', mBlocks);
|
response['mempool-blocks'] = getCachedResponse('mempool-blocks', mBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client['want-tomahawk'] && config.MEMPOOL.BACKEND === 'esplora' && config.ESPLORA.FALLBACK?.length) {
|
if (client['want-tomahawk']) {
|
||||||
response['tomahawk'] = getCachedResponse('tomahawk', bitcoinApi.getHealthStatus());
|
response['tomahawk'] = getCachedResponse('tomahawk', bitcoinApi.getHealthStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user