aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/peer/forget.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 20:38:27 +0100
committertv <tv@krebsco.de>2026-11-01 20:38:27 +0100
commit6d9b462e1bb1e2ebbda6c0dcdcfe22a15d4b4cbe (patch)
tree73a7ece5215045c374ed3b928a8d36b220d50e19 /src/swarm/peer/forget.rs
parentdbb614e1ecf27ca37f54dba4e2c8fe3810af8c8c (diff)
peer worker forget records on change
Diffstat (limited to 'src/swarm/peer/forget.rs')
-rw-r--r--src/swarm/peer/forget.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/swarm/peer/forget.rs b/src/swarm/peer/forget.rs
index 3a97677..68266d5 100644
--- a/src/swarm/peer/forget.rs
+++ b/src/swarm/peer/forget.rs
@@ -24,6 +24,13 @@ pub(crate) fn forgotten_path(pk: &str) -> Vec<String> {
path
}
+/// Whether a change at `path` may change the forget records: one among them, or above
+/// them (the root, after an epoch switch).
+pub(crate) fn affects_forget_records(path: &[String]) -> bool {
+ let dir = forgotten_dir();
+ path.starts_with(&dir) || dir.starts_with(path)
+}
+
fn forgotten_peers(doc: &Document) -> Vec<String> {
store::keys_at(doc, &forgotten_dir()).unwrap_or_default()
}