Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
EOSE handler: divide the connected relays count into 2
Browse files Browse the repository at this point in the history
Signed-off-by: Yonle <[email protected]>
  • Loading branch information
Yonle committed Nov 21, 2023
1 parent 2d73575 commit c26ebbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bouncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function newConn(addr, id) {
case "EOSE":
if (!client.pendingEOSE.has(data[1])) return;
client.pendingEOSE.set(data[1], client.pendingEOSE.get(data[1]) + 1);
if (client.pendingEOSE.get(data[1]) < Array.from(socks).filter(sock => sock.id === id).length) return;
if (client.pendingEOSE.get(data[1]) < (Array.from(socks).filter(sock => sock.id === id).length/2)) return;
client.pendingEOSE.delete(data[1]);
if (client.hold_sess.has(data[1])) return client.hold_sess.delete(data[1]);
client.send(JSON.stringify(data));
Expand Down

0 comments on commit c26ebbd

Please sign in to comment.