diff options
Diffstat (limited to 'src/document/sync.rs')
| -rw-r--r-- | src/document/sync.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/document/sync.rs b/src/document/sync.rs index 114b538..5d139e2 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -661,6 +661,16 @@ impl SyncSession { self.state.sent_hashes.len() } + /// Of those, how many count as sent because another parent brings them + /// (`known_to_peer`). + #[cfg(test)] + pub(crate) fn sent_known_elsewhere_len(&self) -> usize { + self.known_elsewhere + .keys() + .filter(|hash| self.state.sent_hashes.contains(*hash)) + .count() + } + /// Of the changes in `doc` beyond `from`, how many the peer has too, as far as we /// know (its heads' history, and what went either way since, `sent_hashes`). A delta /// it offers from `from` brings those again: offered before it heard what we have |
