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

[fix] replace hardcoded max ws2p quota by constant

parent fa52b6a3
No related branches found
No related tags found
2 merge requests!1222Add startup scripts,!1220Stable/ws2p v1.1 trymerge
......@@ -139,7 +139,7 @@ export class WS2PServer extends events.EventEmitter {
async removeExcessIncomingConnections() {
await this.removeDuplicateConnections()
const ws2pPublicMax = (this.server.conf.ws2p && this.server.conf.ws2p.maxPublic) ? this.server.conf.ws2p.maxPublic:10
const ws2pPublicMax = (this.server.conf.ws2p && this.server.conf.ws2p.maxPublic) ? this.server.conf.ws2p.maxPublic:WS2PConstants.MAX_LEVEL_2_PEERS
let privilegedKeys = (this.server.conf.ws2p && this.server.conf.ws2p.privilegedNodes) ? this.server.conf.ws2p.privilegedNodes:[]
while (this.countConnexions() > ws2pPublicMax) {
await this.removeLowPriorityConnection(privilegedKeys)
......
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