mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-12 14:40:37 +08:00
Currently, if refs are updated while the node is stopped, these refs are not immediately announced when the node starts, due to the node being unaware of the updates. To remedy this, on startup, we compare the refs we have in storage with the refs we announced to the network. Since only our own refs could have changed while the node was stopped, this change only applies to owned refs. If we detect that storage has changed while the node was stopped, we create ref announcements for the updated repos and store them in our gossip database. These announcements will be included with other historical gossip announcements when nodes connect to us. To keep track of what was announced, we store our local node's sync status in the database. This is also useful when using the `rad sync status` command, as it tells us what oid our local node is at, and whether it is aware of our local changes yet. In addition to this, we make a small fix: previously, inventory and ref announcements originating from our local node were not stored in the announcement database. We ensure that they are via the new `announce` method.