diff options
Diffstat (limited to 'src/federation/fold.rs')
| -rw-r--r-- | src/federation/fold.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/federation/fold.rs b/src/federation/fold.rs index 89ce12c..f37c213 100644 --- a/src/federation/fold.rs +++ b/src/federation/fold.rs @@ -642,6 +642,16 @@ impl Fold for Federation { } } + /// A version event's version: an operator having its node drop one has it refuse every + /// version event naming that version, whoever wrote it anew (`docs/federation.md`, + /// Changing the policy). + fn writes(bytes: &[u8]) -> Option<Id> { + match Event::read_taken(bytes) { + Some(Event::Version { version, .. }) => Some(version), + _ => None, + } + } + fn checkpoint(at: &State, heads: &[Id]) -> (Vec<u8>, Vec<Id>) { let current = at.current().clone(); let keeps = at.counting(¤t, true); |
