node: add http indexer info
This commit is contained in:
parent
bd26dbf32d
commit
bb797602e6
@ -127,6 +127,16 @@ class HTTP extends Server {
|
||||
tip: this.chain.tip.rhash(),
|
||||
progress: this.chain.getProgress()
|
||||
},
|
||||
indexes: {
|
||||
addr: {
|
||||
enabled: Boolean(this.node.addrindex),
|
||||
height: this.node.addrindex ? this.node.addrindex.height : 0
|
||||
},
|
||||
tx: {
|
||||
enabled: Boolean(this.node.txindex),
|
||||
height: this.node.txindex ? this.node.txindex.height : 0
|
||||
}
|
||||
},
|
||||
pool: {
|
||||
host: addr.host,
|
||||
port: addr.port,
|
||||
|
||||
@ -89,6 +89,13 @@ describe('HTTP', function() {
|
||||
assert.strictEqual(info.pool.agent, node.pool.options.agent);
|
||||
assert.typeOf(info.chain, 'object');
|
||||
assert.strictEqual(info.chain.height, 0);
|
||||
assert.typeOf(info.indexes, 'object');
|
||||
assert.typeOf(info.indexes.addr, 'object');
|
||||
assert.equal(info.indexes.addr.enabled, false);
|
||||
assert.equal(info.indexes.addr.height, 0);
|
||||
assert.typeOf(info.indexes.tx, 'object');
|
||||
assert.equal(info.indexes.addr.enabled, false);
|
||||
assert.equal(info.indexes.tx.height, 0);
|
||||
});
|
||||
|
||||
it('should get wallet info', async () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user