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,
height: this.chain.height, chain: {
tip: this.chain.tip.rhash(), height: this.chain.height,
outbound: this.pool.peers.outbound.length + loader, tip: this.chain.tip.rhash(),
pending: this.pool.peers.pending.length, progress: this.chain.getProgress()
inbound: this.pool.peers.inbound.length, },
progress: this.chain.getProgress(), pool: {
mempoolTX: totalTX, services: this.pool.services.toString(2),
mempoolSize: size, outbound: this.pool.peers.outbound.length + loader,
uptime: Math.floor(util.uptime()), pending: this.pool.peers.pending.length,
systemTime: util.now(), inbound: this.pool.peers.inbound.length
adjustedTime: this.network.now(), },
timeOffset: this.network.time.offset, mempool: {
tx: totalTX,
size: size
},
time: {
uptime: Math.floor(util.uptime()),
system: util.now(),
adjusted: this.network.now(),
offset: this.network.time.offset
},
memory: getMemory() memory: getMemory()
}); });
}); });