Skip to content
Snippets Groups Projects
Unverified Commit 5eb2f7d4 authored by Éloïs's avatar Éloïs
Browse files

[enh] #1219

parent f417c09f
No related branches found
No related tags found
3 merge requests!1222Add startup scripts,!1220Stable/ws2p v1.1 trymerge,!1208Stable/ws2p v1.1
......@@ -348,6 +348,11 @@ export class WS2PCluster {
}
async connectToWS2Peers() {
// If incoming connections quota is full, delete one low-priority connection
if (this.ws2pServer !== null && this.ws2pServer.countConnexions() === this.ws2pServer.maxLevel2Peers) {
const privilegedKeys = ((this.server.conf.ws2p && this.server.conf.ws2p.privilegedNodes) || []).slice() // Copy
this.ws2pServer.removeLowPriorityConnection(privilegedKeys)
}
const myUUID = (this.server.conf.ws2p && this.server.conf.ws2p.uuid) ? this.server.conf.ws2p.uuid:""
const potentials = await this.server.dal.getWS2Peers()
const peers:PeerDTO[] = potentials.map((p:any) => PeerDTO.fromJSONObject(p))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment