summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 04:23:38 +0200
committertv <tv@krebsco.de>2026-10-24 04:47:07 +0200
commit6fa188610ce0959e0b61ecaf63f5babf826d2071 (patch)
treea955457989abfe4832fe0213b5054d3b34c98ab1 /src/state.rs
parentc2468964b11bd3606f03375c370fd181a1723113 (diff)
pull missing changes
Nodes push changes to their neighbours but don't relay them directly. In a partial mesh, nodes can learn about missing changes via keepalive messages and can pull them from their neighbours.
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs
index 7574e35..10471df 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -536,6 +536,8 @@ pub(crate) struct AppState {
/// Target number of neighbours (`--neighbours`); up to this many + 1 members the
/// swarm is a full mesh.
pub(crate) neighbours_k: usize,
+ /// The neighbour we are pulling changes from, and since when (`swarm::relay`).
+ pub(crate) pulling: Arc<std::sync::Mutex<Option<(String, Instant)>>>,
/// Our neighbours, once known (`swarm::topology`).
pub(crate) neighbours: Arc<std::sync::RwLock<Option<crate::swarm::topology::NeighbourView>>>,