int overflow no. 2 fixed

This commit is contained in:
Lyn 2025-01-14 13:55:22 +01:00
parent 26ed900d41
commit d5cc055d39

View file

@ -473,7 +473,7 @@ impl State {
let mut peer_vec = self
.peers
.iter()
.filter(|(_, info)| now < info.last_seen + TIMEOUT.as_secs() && info.endpoint.is_some())
.filter(|(_, info)| info.last_seen != u64::MAX && now < info.last_seen + TIMEOUT.as_secs() && info.endpoint.is_some())
.map(|(_, info)| (info.gossip_ip, info.gossip_prio))
.collect::<Vec<_>>();
peer_vec.sort_by_key(|(_, prio)| *prio);