http: refactor info.

This commit is contained in:
Christopher Jeffrey 2016-12-15 19:57:04 -08:00
parent d661496541
commit 67ffecc989
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -636,20 +636,28 @@ HTTPServer.prototype._init = function _init() {
send(200, { send(200, {
version: constants.USER_VERSION, version: constants.USER_VERSION,
agent: constants.USER_AGENT, agent: constants.USER_AGENT,
services: this.pool.services.toString(2),
network: this.network.type, network: this.network.type,
chain: {
height: this.chain.height, height: this.chain.height,
tip: this.chain.tip.rhash(), tip: this.chain.tip.rhash(),
progress: this.chain.getProgress()
},
pool: {
services: this.pool.services.toString(2),
outbound: this.pool.peers.outbound.length + loader, outbound: this.pool.peers.outbound.length + loader,
pending: this.pool.peers.pending.length, pending: this.pool.peers.pending.length,
inbound: this.pool.peers.inbound.length, inbound: this.pool.peers.inbound.length
progress: this.chain.getProgress(), },
mempoolTX: totalTX, mempool: {
mempoolSize: size, tx: totalTX,
size: size
},
time: {
uptime: Math.floor(util.uptime()), uptime: Math.floor(util.uptime()),
systemTime: util.now(), system: util.now(),
adjustedTime: this.network.now(), adjusted: this.network.now(),
timeOffset: this.network.time.offset, offset: this.network.time.offset
},
memory: getMemory() memory: getMemory()
}); });
}); });