fix: remove ADVERT timestamp validation — field isn't stored or used

Timestamp is decoded from the ADVERT but never persisted to the nodes
table. The validation was rejecting valid nodes with slightly-off clocks
(28h future) and nodes broadcasting timestamp=4. No reason to gate on it.
This commit is contained in:
you
2026-03-21 21:31:25 +00:00
parent ebc72fa364
commit 32b897d8f3

View File

@@ -311,14 +311,7 @@ function validateAdvert(advert) {
if (!VALID_ROLES.has(role)) return { valid: false, reason: `unknown role: ${role}` };
}
// timestamp sanity: must be after 2020-01-01 and not more than 1 day in the future
if (advert.timestamp != null) {
const MIN_TS = 1577836800; // 2020-01-01
const MAX_TS = Math.floor(Date.now() / 1000) + 86400; // now + 1 day
if (advert.timestamp < MIN_TS || advert.timestamp > MAX_TS) {
return { valid: false, reason: `timestamp out of range: ${advert.timestamp}` };
}
}
// timestamp: decoded but not currently used for node storage — skip validation
return { valid: true };
}