summaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/peer/inbound.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs
index a1f6646..b04aad9 100644
--- a/src/swarm/peer/inbound.rs
+++ b/src/swarm/peer/inbound.rs
@@ -30,6 +30,10 @@ pub(crate) async fn handle_message(
debug!("Ignoring message from self");
return Ok(());
}
+ // WHO and ME end at the identity layer (`transport::identity`).
+ let Some((epoch, epoch_seq)) = message.epoch_stamp() else {
+ return Ok(());
+ };
// A reply to a HELLO from an earlier run of ours (late, or queued by the transport
// while we were down) says nothing about now; the peer answers our current HELLO.
@@ -70,8 +74,7 @@ pub(crate) async fn handle_message(
transport::ParsedMessage::HelloReply(reply) => Some(reply.sender_run_id),
_ => None,
};
- let same_epoch =
- observe_peer_epoch(state, &peer, message.epoch(), message.epoch_seq(), run).await;
+ let same_epoch = observe_peer_epoch(state, &peer, epoch, epoch_seq, run).await;
//debug!(from = %peer, message = ?message, "Received message");
@@ -155,6 +158,7 @@ pub(crate) async fn handle_message(
state.lock_rtt().pong_received(&peer, Instant::now());
on_keepalive(state, &peer, &remote, reactivated).await;
}
+ transport::ParsedMessage::Who(_) | transport::ParsedMessage::Me(_) => {}
}
Ok(())