From e4c01ae828eb446533173384b5fdb98cfbe84c51 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 9 Jan 2022 17:02:26 +0000 Subject: [PATCH] Fix PeerServer API bugs --- src/lib/agent/Agent.mjs | 3 ++- src/lib/agent/PeerServer.mjs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/agent/Agent.mjs b/src/lib/agent/Agent.mjs index 65e474f..5694e79 100644 --- a/src/lib/agent/Agent.mjs +++ b/src/lib/agent/Agent.mjs @@ -54,7 +54,8 @@ class Agent { await this.server.add_peers(...this.config.peers.map( peer => parse_peer_name(peer) )); - l.log(`Added ${this.config.peers.length} initial peers`); + + l.log(`Added ${this.server.peers().length} / ${this.config.peers.length} initial peers`); if(this.config.peers.length < 1) l.warn(`No initial peers were specified! It's recommended that you specify at least 1 on every host.`); } diff --git a/src/lib/agent/PeerServer.mjs b/src/lib/agent/PeerServer.mjs index c65109c..17bca10 100644 --- a/src/lib/agent/PeerServer.mjs +++ b/src/lib/agent/PeerServer.mjs @@ -103,7 +103,7 @@ class PeerServer extends EventEmitter { */ peers() { return this.connected_peers.map((peer) => peer.remote_endpoint) - .filter(el => typeof el.addr === "string" && typeof el.port === "number"); + .filter(el => typeof el.address === "string" && typeof el.port === "number"); } /**