diff options
| author | tv <tv@krebsco.de> | 2026-11-16 20:48:03 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 22:03:41 +0100 |
| commit | 0e1238015e55854515a4cbc6b6ef757792e7d804 (patch) | |
| tree | bc7c008dfdf36d78d1e80f10d03e13926690749e /src/swarm/peer/inbound.rs | |
| parent | c534b25dbd94dc41731f98e4c4b2a170fe02c347 (diff) | |
peer: in a swarm holding a store, its members only
A node of a swarm holding a store syncs with its members only (`docs/store.md`,
Members): the nodes its store names, each with the party its handshakes name, as the
store reads now. A handshake from any other goes unanswered, and what the node had with
it ends, as with a banned node; so does what it had with a member at its next message,
once the store names it no more (`swarm::peer::members`). The party a handshake names is
kept with the peer. While a node holds no store yet, joining, it can't tell, and takes
everyone of its swarm: its seeds, which take it only where its party lists it.
A node says whether it is a member itself, as its store reads, when that changes.
Diffstat (limited to 'src/swarm/peer/inbound.rs')
| -rw-r--r-- | src/swarm/peer/inbound.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs index 4a5b6ac..d266e5f 100644 --- a/src/swarm/peer/inbound.rs +++ b/src/swarm/peer/inbound.rs @@ -96,6 +96,13 @@ pub(crate) async fn handle_message( return Ok(()); } + // In a swarm holding a store, its members only, each as the party its handshakes name + // (`members`). + #[cfg(feature = "federation")] + if !super::members::member(state, &peer, &message).await { + 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 { |
