summaryrefslogtreecommitdiffstats
path: root/src/swarm/relay.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm/relay.rs')
-rw-r--r--src/swarm/relay.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/swarm/relay.rs b/src/swarm/relay.rs
index 4bfc2b6..34451c9 100644
--- a/src/swarm/relay.rs
+++ b/src/swarm/relay.rs
@@ -103,8 +103,9 @@ pub(crate) async fn pull_if_behind(state: &AppState, peer: &str, remote: &transp
if remote.epoch != state.local_epoch() || !topology::is_neighbour(state, peer) {
return;
}
- // The common case, the same heads, needs only the cached heads (read lock).
- if HeadsSummary::of(state.doc.read().await.heads().to_vec()) == remote.heads {
+ // The common case, the same heads, needs only the published heads.
+ let ours = HeadsSummary::of(state.stamp.borrow().heads.to_vec());
+ if ours == remote.heads {
return;
}
let missing = match &remote.heads {