diff options
| -rw-r--r-- | src/document/sync.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/document/sync.rs b/src/document/sync.rs index eed0024..114b538 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -842,6 +842,11 @@ impl SyncSession { peer: &str, now: Instant, ) -> (usize, usize) { + // Pruned here too, on every message from the peer: `known_to_peer` prunes only + // when another parent brings something, which stops when the peer is no longer + // covered by one. + self.known_elsewhere + .retain(|_, at| now.saturating_duration_since(*at) < KNOWN_ELSEWHERE_KEPT); let mut asked = (0, 0); for hash in self.state.their_need.iter().flatten() { if let Some(at) = self.known_elsewhere.remove(hash) { |
