diff options
| author | tv <tv@krebsco.de> | 2026-11-01 20:38:27 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-01 20:38:27 +0100 |
| commit | 7d9f3a0db5d0421a2e3fac54e920718f0fdd1f7c (patch) | |
| tree | 1ae9f3987e28d05f9ac9014170efc904b7490687 /src/swarm/peer/forget.rs | |
| parent | d09ec56ca2cdaf8060819a70ca2d89bd0458896f (diff) | |
peer worker forget records on change
Diffstat (limited to 'src/swarm/peer/forget.rs')
| -rw-r--r-- | src/swarm/peer/forget.rs | 7 |
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() } |
