Loading app/modules/ws2p/lib/WS2PCluster.ts +4 −4 Original line number Diff line number Diff line Loading @@ -681,11 +681,11 @@ export class WS2PCluster { let uuids = Object.keys(this.ws2pClients) uuids = _.shuffle(uuids) let lowPriorityConnectionUUID:string = uuids[0] let minPriorityLevel = this.keyPriorityLevel(this.ws2pClients[lowPriorityConnectionUUID].connection.pubkey, preferedKeys) let minPriorityLevel = await this.keyPriorityLevel(this.ws2pClients[lowPriorityConnectionUUID].connection.pubkey, preferedKeys) for (const uuid of uuids) { const client = this.ws2pClients[uuid] if (uuid !== lowPriorityConnectionUUID) { let uuidPriorityLevel = this.keyPriorityLevel(client.connection.pubkey, preferedKeys) let uuidPriorityLevel = await this.keyPriorityLevel(client.connection.pubkey, preferedKeys) if (uuidPriorityLevel < minPriorityLevel) { lowPriorityConnectionUUID = uuid minPriorityLevel = uuidPriorityLevel Loading app/modules/ws2p/lib/WS2PServer.ts +2 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import {WS2PConstants} from "./constants" import {WS2PMessageHandler} from "./impl/WS2PMessageHandler" import {WS2PStreamer} from "./WS2PStreamer" import {WS2PSingleWriteStream} from "./WS2PSingleWriteStream" import { WS2PCluster } from './WS2PCluster'; const WebSocketServer = require('ws').Server Loading Loading @@ -159,10 +158,10 @@ export class WS2PServer extends events.EventEmitter { async removeLowPriorityConnection(privilegedKeys:string[]) { let lowPriorityConnection:WS2PConnection = this.connections[0] let minPriorityLevel = this.keyPriorityLevel(lowPriorityConnection.pubkey, privilegedKeys) let minPriorityLevel = await this.keyPriorityLevel(lowPriorityConnection.pubkey, privilegedKeys) for (const c of this.connections) { if (c !== lowPriorityConnection) { let cPriorityLevel = this.keyPriorityLevel(c.pubkey, privilegedKeys) let cPriorityLevel = await this.keyPriorityLevel(c.pubkey, privilegedKeys) if (cPriorityLevel < minPriorityLevel) { lowPriorityConnection = c minPriorityLevel = cPriorityLevel Loading Loading
app/modules/ws2p/lib/WS2PCluster.ts +4 −4 Original line number Diff line number Diff line Loading @@ -681,11 +681,11 @@ export class WS2PCluster { let uuids = Object.keys(this.ws2pClients) uuids = _.shuffle(uuids) let lowPriorityConnectionUUID:string = uuids[0] let minPriorityLevel = this.keyPriorityLevel(this.ws2pClients[lowPriorityConnectionUUID].connection.pubkey, preferedKeys) let minPriorityLevel = await this.keyPriorityLevel(this.ws2pClients[lowPriorityConnectionUUID].connection.pubkey, preferedKeys) for (const uuid of uuids) { const client = this.ws2pClients[uuid] if (uuid !== lowPriorityConnectionUUID) { let uuidPriorityLevel = this.keyPriorityLevel(client.connection.pubkey, preferedKeys) let uuidPriorityLevel = await this.keyPriorityLevel(client.connection.pubkey, preferedKeys) if (uuidPriorityLevel < minPriorityLevel) { lowPriorityConnectionUUID = uuid minPriorityLevel = uuidPriorityLevel Loading
app/modules/ws2p/lib/WS2PServer.ts +2 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import {WS2PConstants} from "./constants" import {WS2PMessageHandler} from "./impl/WS2PMessageHandler" import {WS2PStreamer} from "./WS2PStreamer" import {WS2PSingleWriteStream} from "./WS2PSingleWriteStream" import { WS2PCluster } from './WS2PCluster'; const WebSocketServer = require('ws').Server Loading Loading @@ -159,10 +158,10 @@ export class WS2PServer extends events.EventEmitter { async removeLowPriorityConnection(privilegedKeys:string[]) { let lowPriorityConnection:WS2PConnection = this.connections[0] let minPriorityLevel = this.keyPriorityLevel(lowPriorityConnection.pubkey, privilegedKeys) let minPriorityLevel = await this.keyPriorityLevel(lowPriorityConnection.pubkey, privilegedKeys) for (const c of this.connections) { if (c !== lowPriorityConnection) { let cPriorityLevel = this.keyPriorityLevel(c.pubkey, privilegedKeys) let cPriorityLevel = await this.keyPriorityLevel(c.pubkey, privilegedKeys) if (cPriorityLevel < minPriorityLevel) { lowPriorityConnection = c minPriorityLevel = cPriorityLevel Loading