Fix PeerServer API bugs
This commit is contained in:
parent
63b698573f
commit
e4c01ae828
2 changed files with 3 additions and 2 deletions
|
@ -54,7 +54,8 @@ class Agent {
|
||||||
await this.server.add_peers(...this.config.peers.map(
|
await this.server.add_peers(...this.config.peers.map(
|
||||||
peer => parse_peer_name(peer)
|
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)
|
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.`);
|
l.warn(`No initial peers were specified! It's recommended that you specify at least 1 on every host.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ class PeerServer extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
peers() {
|
peers() {
|
||||||
return this.connected_peers.map((peer) => peer.remote_endpoint)
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue