From 93defc68f9b99da921f4746e91e5cee9e6e3f1b9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 17:39:23 +0000 Subject: swarm: a node says to each peer the kind that peer holds, of those it holds A node holds one kind of document, or, to come, its store in both (Holding::kinds, of_both). The kind a peer's handshakes say is kept with the peer, where the node holds it too, and is what the node says to it in turn; to a peer that said none yet, a node of more than one kind says each in turn, HELLO by HELLO, until one is answered. A node of one kind says and takes that one, as before. --- src/state/peer.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index 721a754..356736a 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -92,6 +92,9 @@ pub(crate) struct PeerState { /// The party its handshakes name, in a swarm holding a store (`swarm::peer::members`). #[cfg(feature = "federation")] pub(crate) party: Option, + /// The kind of document its handshakes say it holds, of those this node holds: what + /// this node says to it in turn, and passes on to it (`swarm::peer::inbound`). + pub(crate) kind: Option<&'static str>, pub(crate) hello_state: HelloState, /// Wait between unanswered HELLOs; reset whenever a new handshake starts. pub(crate) hello_backoff: Backoff, @@ -339,6 +342,7 @@ impl PeerState { tree_writer: None, left: false, hello_attempts: 0, + kind: None, last_hello_at: None, unreachable_since: None, incidents: Incidents::default(), -- cgit v1.3.1