aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/peer/inbound.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 06:19:34 +0100
committertv <tv@krebsco.de>2026-10-31 06:19:34 +0100
commit7997793798b8364212fd0f009a68394d61a83e47 (patch)
tree13621c9dee8d1faf35a3524992c413f10aad9344 /src/swarm/peer/inbound.rs
parent7a0d6c0d644cb7328cdae24aebc08375c3ba6d94 (diff)
dashboard: try to get links dormant immediately
Diffstat (limited to 'src/swarm/peer/inbound.rs')
-rw-r--r--src/swarm/peer/inbound.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs
index b4a96e4..b57feaf 100644
--- a/src/swarm/peer/inbound.rs
+++ b/src/swarm/peer/inbound.rs
@@ -58,17 +58,23 @@ pub(crate) async fn handle_message(
remember_peer(state, &peer).await;
- // Any inbound message proves liveness. When we heard from it before tells a
- // restarted peer how long it was away (in our HELLO_REPLY).
- let peer_state = state.get_or_create_peer_state(&peer).await;
- let (reactivated, previously_seen) =
- heard_from(state, &peer, &peer_state, Instant::now(), |_| {}).await;
-
let run = match &message {
transport::ParsedMessage::Hello(hello) => Some(hello.run_id),
transport::ParsedMessage::HelloReply(reply) => Some(reply.sender_run_id),
_ => None,
};
+
+ // Any inbound message proves liveness (but from a run that said farewell: its next
+ // one does). When we heard from it before tells a restarted peer how long it was
+ // away (in our HELLO_REPLY).
+ let peer_state = state.get_or_create_peer_state(&peer).await;
+ let (reactivated, previously_seen) =
+ heard_from(state, &peer, &peer_state, Instant::now(), |peer_state| {
+ if let Some(run) = run {
+ peer_state.returned(run);
+ }
+ })
+ .await;
let same_epoch = observe_peer_epoch(state, &peer, epoch, epoch_seq, run).await;
match message {