diff options
Diffstat (limited to 'src/swarm/peer/inbound.rs')
| -rw-r--r-- | src/swarm/peer/inbound.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs index a7633b3..3ddaf08 100644 --- a/src/swarm/peer/inbound.rs +++ b/src/swarm/peer/inbound.rs @@ -96,6 +96,18 @@ pub(crate) async fn handle_message( return Ok(()); } + // The root its document starts from: another than ours, of our epoch, is another + // history; what a joiner takes as its root follows those named (`swarm::roots`). + match &message { + ParsedMessage::Hello(hello) => { + crate::swarm::roots::heard(state, &peer, epoch, hello.root.as_deref()).await? + } + ParsedMessage::HelloReply(reply) => { + crate::swarm::roots::heard(state, &peer, epoch, reply.root.as_deref()).await? + } + _ => {} + } + remember_peer(state, &peer).await; let run = match &message { |
