From fe552c8a4bc29376e836768910b3518d55d05796 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 18:50:50 +0000 Subject: [PATCH] fix: Pass 2 hash_size was overwriting ADVERT-derived values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass 1 correctly uses last-wins for ADVERT packets. But Pass 2 (fallback for nodes without ADVERTs) was also unconditionally overwriting, so a stale 1-byte non-ADVERT packet would clobber the correct 2-byte value from Pass 1. Restored the !hashSizeMap.has() guard on Pass 2 only — it should only fill gaps, never override ADVERT-derived hash_size. --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 01ec834..f1c04fe 100644 --- a/server.js +++ b/server.js @@ -1111,7 +1111,7 @@ app.get('/api/nodes', (req, res) => { if (p.decoded_json) { const d = JSON.parse(p.decoded_json); const pk = d.pubKey || d.public_key; - if (pk) hashSizeMap.set(pk, hs); + if (pk && !hashSizeMap.has(pk)) hashSizeMap.set(pk, hs); } } }