mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-30 15:55:49 +00:00
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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user