Only apply offset to times in the future
Times in the past don't have any security implications, so there's no point in trying to apply the offset to them as well.
This commit is contained in:
parent
876d515dd6
commit
fa35c9b4f1
|
@ -375,7 +375,12 @@ fn limit_last_seen_times(addrs: &mut Vec<MetaAddr>, last_seen_limit: DateTime32)
|
||||||
let offset = most_recent_reported_seen_time.timestamp() - last_seen_limit.timestamp();
|
let offset = most_recent_reported_seen_time.timestamp() - last_seen_limit.timestamp();
|
||||||
|
|
||||||
for addr in addrs {
|
for addr in addrs {
|
||||||
let last_seen = addr.get_last_seen().timestamp() - offset;
|
let old_last_seen = addr.get_last_seen().timestamp();
|
||||||
addr.set_last_seen(last_seen.into());
|
|
||||||
|
if old_last_seen > last_seen_limit.timestamp() {
|
||||||
|
let new_last_seen = old_last_seen - offset;
|
||||||
|
|
||||||
|
addr.set_last_seen(new_last_seen.into());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue