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