From 4cdeec40b6e27085f9d42049088dca61c440cc2c Mon Sep 17 00:00:00 2001 From: Yonle Date: Fri, 3 Nov 2023 17:19:37 +0700 Subject: [PATCH] fix the improvement for pendingEOSE in mode 2 Signed-off-by: Yonle --- bouncer/bouncer2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bouncer/bouncer2.js b/bouncer/bouncer2.js index c2bf176..111b9cf 100644 --- a/bouncer/bouncer2.js +++ b/bouncer/bouncer2.js @@ -128,7 +128,7 @@ function newConn(addr, id) { case "EOSE": if (!pendingEOSE.has(id + ":" + data[1])) return; pendingEOSE.set(id + ":" + data[1], pendingEOSE.get(id + ":" + data[1]) + 1); - if (pendingEOSE.get(id + ":" + data[1]) < relays.length) return; + if (pendingEOSE.get(id + ":" + data[1]) < Object.from(relays).filter(_ => _.id === id).length) return; csess.get(id)?.send(JSON.stringify(data)); break; }