aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/peer/forget.rs
diff options
context:
space:
mode:
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()
}