aboutsummaryrefslogtreecommitdiffstats
path: root/src/state
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 05:20:59 +0100
committertv <tv@krebsco.de>2026-11-03 05:20:59 +0100
commit96d7744dd29a3c783b43a7a6697af7d5d5719a10 (patch)
treeddc154200b6086f5f9832237b6a620670ba8b4c3 /src/state
parent9ee8bae8cd740fc038ac6ca14eae4fad458cda31 (diff)
add writer trees
Diffstat (limited to 'src/state')
-rw-r--r--src/state/mod.rs7
-rw-r--r--src/state/peer.rs4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs
index 92f7810..57dab7d 100644
--- a/src/state/mod.rs
+++ b/src/state/mod.rs
@@ -149,9 +149,10 @@ pub(crate) struct AppState {
pub(crate) throughput: Arc<std::sync::Mutex<ThroughputTable>>,
/// Pulls of changes from neighbours (`swarm::relay`).
pub(crate) pulling: Arc<std::sync::Mutex<crate::swarm::relay::Pulling>>,
- /// An announcement round is scheduled, for changes from these peers
- /// (`swarm::relay`).
- pub(crate) announce_pending: Arc<std::sync::Mutex<Option<std::collections::HashSet<String>>>>,
+ /// An announcement round is scheduled (`swarm::relay`).
+ pub(crate) announce_pending: Arc<std::sync::Mutex<Option<crate::swarm::relay::Pending>>>,
+ /// Distances in writers' trees (`swarm::tree`).
+ pub(crate) trees: Arc<std::sync::Mutex<crate::swarm::tree::Trees>>,
/// Whom we reach, as told our neighbours (`swarm::reach`).
pub(crate) reach: Arc<std::sync::Mutex<crate::swarm::reach::Reach>>,
/// Our neighbours, once known (`swarm::topology`).
diff --git a/src/state/peer.rs b/src/state/peer.rs
index 1e09079..06269e9 100644
--- a/src/state/peer.rs
+++ b/src/state/peer.rs
@@ -153,6 +153,9 @@ pub(crate) struct PeerState {
pub(crate) eager_from: bool,
/// Whom it said it reaches (`swarm::reach`), by pair key, and when.
pub(crate) reaches: Option<(Instant, Vec<u64>)>,
+ /// Whose change the next sync message to it passes on along the writer's tree
+ /// (`swarm::tree`); taken when it is generated.
+ pub(crate) tree_writer: Option<u64>,
/// It said farewell (`say_farewell`): what else that run of it still sends while it
/// stops doesn't make it active again; a message from another run does (`returned`).
@@ -247,6 +250,7 @@ impl PeerState {
eager_to: false,
eager_from: false,
reaches: None,
+ tree_writer: None,
left: false,
hello_attempts: 0,
unreachable_since: None,