From 6d9b462e1bb1e2ebbda6c0dcdcfe22a15d4b4cbe Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2026 20:38:27 +0100 Subject: peer worker forget records on change --- src/swarm/peer/forget.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/swarm/peer/forget.rs') 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 { 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 { store::keys_at(doc, &forgotten_dir()).unwrap_or_default() } -- cgit v1.3.1