Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Small fix to sync-status
cloudhead committed 2 years ago
commit 3ad97fde0b88869d744569a38291521ddb5b1cf0
parent 638c2a3e4c9755a98aa24f2c3c2ca6277e9c693a
1 file changed +5 -9
modified radicle-node/src/service.rs
@@ -490,16 +490,12 @@ where
                if updated_at.oid == announced.oid {
                    continue;
                }
-
            } else {
-
                debug!(target: "service", "Saving local sync status for {rid}..");
-
                // If we don't have a sync status for this repo, create one.
-
                self.addresses.synced(
-
                    &rid,
-
                    &nid,
-
                    updated_at.oid,
-
                    updated_at.timestamp.as_millis(),
-
                )?;
            }
+
            // Make sure our local node's sync status is up to date with storage.
+
            debug!(target: "service", "Saving local sync status for {rid}..");
+
            self.addresses
+
                .synced(&rid, &nid, updated_at.oid, updated_at.timestamp.as_millis())?;
+

            // If we got here, it likely means a repo was updated while the node was stopped.
            // Therefore, we pre-load a refs announcement for this repo, so that it is included in
            // the historical gossip messages when a node connects and subscribes to this repo.