rpc: fix peer.hostname.

This commit is contained in:
Christopher Jeffrey 2017-01-21 04:12:39 -08:00
parent 59e73b24ca
commit 9d580289ab
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -463,11 +463,11 @@ RPC.prototype.getaddednodeinfo = co(function* getaddednodeinfo(args) {
RPC.prototype._toAddedNode = function _toAddedNode(peer) {
return {
addednode: peer.hostname,
addednode: peer.hostname(),
connected: peer.connected,
addresses: [
{
address: peer.hostname,
address: peer.hostname(),
connected: peer.outbound
? 'outbound'
: 'inbound'
@ -512,15 +512,15 @@ RPC.prototype.getpeerinfo = co(function* getpeerinfo(args) {
throw new RPCError('getpeerinfo');
for (peer = this.pool.peers.head(); peer; peer = peer.next) {
offset = this.network.time.known[peer.hostname];
offset = this.network.time.known[peer.hostname()];
if (offset == null)
offset = 0;
peers.push({
id: id++,
addr: peer.hostname,
addrlocal: peer.hostname,
addr: peer.hostname(),
addrlocal: peer.hostname(),
relaytxes: peer.outbound,
lastsend: peer.lastSend / 1000 | 0,
lastrecv: peer.lastRecv / 1000 | 0,