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 | ae2a573e2753e1e7a11b94e2a721cb4d638079b3 (patch) | |
| tree | 0a83dbba3a23a864f9024395e8e5abc4155dbf63 /src/swarm/peer/forget.rs | |
| parent | e293047c25d7167f25af0a611b33545f12225b05 (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() } |
