Add hostname to initial websocket data.

This commit is contained in:
softsimon 2020-05-26 16:34:55 +07:00
parent 4ece586709
commit 5b80b43e2a
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -7,6 +7,7 @@ import blocks from './blocks';
import memPool from './mempool';
import mempoolBlocks from './mempool-blocks';
import fiatConversion from './fiat-conversion';
import * as os from 'os';
class WebsocketHandler {
private wss: WebSocket.Server | undefined;
@ -92,7 +93,8 @@ class WebsocketHandler {
'blocks': _blocks.slice(Math.max(_blocks.length - config.INITIAL_BLOCK_AMOUNT, 0)),
'conversions': fiatConversion.getTickers()['BTCUSD'],
'mempool-blocks': mempoolBlocks.getMempoolBlocks(),
'git-commit': this.latestGitCommitHash
'git-commit': this.latestGitCommitHash,
'hostname': os.hostname(),
}));
}