rpc: fix peer.hostname.
This commit is contained in:
parent
59e73b24ca
commit
9d580289ab
@ -463,11 +463,11 @@ RPC.prototype.getaddednodeinfo = co(function* getaddednodeinfo(args) {
|
|||||||
|
|
||||||
RPC.prototype._toAddedNode = function _toAddedNode(peer) {
|
RPC.prototype._toAddedNode = function _toAddedNode(peer) {
|
||||||
return {
|
return {
|
||||||
addednode: peer.hostname,
|
addednode: peer.hostname(),
|
||||||
connected: peer.connected,
|
connected: peer.connected,
|
||||||
addresses: [
|
addresses: [
|
||||||
{
|
{
|
||||||
address: peer.hostname,
|
address: peer.hostname(),
|
||||||
connected: peer.outbound
|
connected: peer.outbound
|
||||||
? 'outbound'
|
? 'outbound'
|
||||||
: 'inbound'
|
: 'inbound'
|
||||||
@ -512,15 +512,15 @@ RPC.prototype.getpeerinfo = co(function* getpeerinfo(args) {
|
|||||||
throw new RPCError('getpeerinfo');
|
throw new RPCError('getpeerinfo');
|
||||||
|
|
||||||
for (peer = this.pool.peers.head(); peer; peer = peer.next) {
|
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)
|
if (offset == null)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
peers.push({
|
peers.push({
|
||||||
id: id++,
|
id: id++,
|
||||||
addr: peer.hostname,
|
addr: peer.hostname(),
|
||||||
addrlocal: peer.hostname,
|
addrlocal: peer.hostname(),
|
||||||
relaytxes: peer.outbound,
|
relaytxes: peer.outbound,
|
||||||
lastsend: peer.lastSend / 1000 | 0,
|
lastsend: peer.lastSend / 1000 | 0,
|
||||||
lastrecv: peer.lastRecv / 1000 | 0,
|
lastrecv: peer.lastRecv / 1000 | 0,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user