From ad917ffd3f76316e48b89ff17e2f8a600a269481 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 29 Sep 2022 15:53:54 +0200 Subject: Fix instant substractions that might have panicked --- src/rpc/system.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/rpc/system.rs') diff --git a/src/rpc/system.rs b/src/rpc/system.rs index f8121193..9e0bfa11 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -369,7 +369,9 @@ impl System { id: n.id.into(), addr: n.addr, is_up: n.is_up(), - last_seen_secs_ago: n.last_seen.map(|t| (Instant::now() - t).as_secs()), + last_seen_secs_ago: n + .last_seen + .map(|t| (Instant::now().saturating_duration_since(t)).as_secs()), status: node_status .get(&n.id.into()) .cloned() -- cgit v1.2.3