Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: avoid the `bool`
✗ CI failure Fintan Halpenny committed 7 months ago
commit 1a55c8e22c7ab5ab013f80752d861098adcb2f54
parent 7effa7c64c63637ae53c4a169bcaeb06c2205c4b
1 failed 1 pending (2 total) View logs
1 file changed +7 -4
modified crates/radicle-protocol/src/service.rs
@@ -1225,7 +1225,7 @@ where
                } else {
                    // Finally, announce the refs. This is useful for nodes to know what we've synced,
                    // beyond just knowing that we have added an item to our inventory.
-
                    if let Err(e) = self.announce_refs(rid, doc.into(), namespaces, false) {
+
                    if let Err(e) = self.announce_refs(rid, doc.into(), namespaces) {
                        error!(target: "service", "Failed to announce new refs: {e}");
                    }
                }
@@ -2172,7 +2172,7 @@ where
        doc: Doc,
        namespaces: impl IntoIterator<Item = NodeId>,
    ) -> Result<(Vec<RefsAt>, Timestamp), Error> {
-
        let (refs, timestamp) = self.announce_refs(rid, doc, namespaces, true)?;
+
        let (refs, timestamp) = self.announce_refs(rid, doc, namespaces)?;

        // Update refs database with our signed refs branches.
        // This isn't strictly necessary for now, as we only use the database for fetches, and
@@ -2206,15 +2206,18 @@ where
        rid: RepoId,
        doc: Doc,
        remotes: impl IntoIterator<Item = NodeId>,
-
        own: bool,
    ) -> Result<(Vec<RefsAt>, Timestamp), Error> {
+
        let local = *self.nid();
        let (ann, refs) = self.refs_announcement_for(rid, remotes)?;
        let timestamp = ann.timestamp();
        let peers = self.sessions.connected().map(|(_, p)| p);

        // Update our sync status for our own refs. This is useful for determining if refs were
        // updated while the node was stopped.
-
        for r in refs.iter().filter(|r| own || r.remote == ann.node) {
+
        for r in refs
+
            .iter()
+
            .filter(|r| r.remote == local || r.remote == ann.node)
+
        {
            info!(
                target: "service",
                "Announcing refs {rid}/{r} to peers (t={timestamp})..",