Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Allow seed not to be connected on fetch
Alexis Sellier committed 2 years ago
commit 5a46ded318d127413f26306e4198579f945abc10
parent 95e3b9673d5721d63be1fc60abb0ae201be9be79
1 file changed +6 -2
modified radicle-node/src/service.rs
@@ -555,8 +555,12 @@ where
            error!(target: "service", "Session {from} does not exist; cannot initiate fetch");
            return;
        };
-
        debug_assert!(session.is_connected());
-

+
        if !session.is_connected() {
+
            // This can happen if a session disconnects in the time between asking for seeds to
+
            // fetch from, and initiating the fetch from one of those seeds.
+
            error!(target: "service", "Session {from} is not connected; cannot initiate fetch");
+
            return;
+
        }
        let seed = session.id;

        match session.fetch(rid) {