Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Don't panic if we can't decode announcements
cloudhead committed 1 year ago
commit 484cf0220cca07cea1863d0e20d44827683da901
parent 83786fbd80ee6ca9fdc19c32e5353d3439d219ab
2 files changed +5 -3
modified radicle-node/src/service/gossip/store.rs
@@ -363,15 +363,15 @@ mod parse {
        let gt = row.read::<GossipType, _>("type");
        let message = match gt {
            GossipType::Refs => {
-
                let ann = row.read::<RefsAnnouncement, _>("message");
+
                let ann = row.try_read::<RefsAnnouncement, _>("message")?;
                AnnouncementMessage::Refs(ann)
            }
            GossipType::Inventory => {
-
                let ann = row.read::<InventoryAnnouncement, _>("message");
+
                let ann = row.try_read::<InventoryAnnouncement, _>("message")?;
                AnnouncementMessage::Inventory(ann)
            }
            GossipType::Node => {
-
                let ann = row.read::<NodeAnnouncement, _>("message");
+
                let ann = row.try_read::<NodeAnnouncement, _>("message")?;
                AnnouncementMessage::Node(ann)
            }
        };
modified radicle/src/node/db/migrations/6.sql
@@ -1,3 +1,5 @@
-- Add the version and user-agent columns.
alter table "nodes" add column "version" integer not null default 1;
alter table "nodes" add column "agent" text not null default "/radicle/";
+
-- Delete all cached announcements, since they no longer match our format.
+
delete from "announcements";