Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
protocol: reuse session address for reconnect
Fintan Halpenny committed 3 months ago
commit 906a0992d27bbfbde7914e62f8acbb09a1edc627
parent d2ab7b1b46935c95a46d0e7ddac3130b595eb15a
1 file changed +2 -2
modified crates/radicle-protocol/src/service.rs
@@ -2660,13 +2660,13 @@ where
        let mut reconnect = Vec::new();

        for (nid, session) in self.sessions.iter_mut() {
-
            if let Some(addr) = self.config.peer(nid) {
+
            if self.config.is_persistent(nid) {
                if let session::State::Disconnected { retry_at, .. } = &mut session.state {
                    // TODO: Try to reconnect only if the peer was attempted. A disconnect without
                    // even a successful attempt means that we're unlikely to be able to reconnect.

                    if now >= *retry_at {
-
                        reconnect.push((*nid, addr.clone(), session.attempts()));
+
                        reconnect.push((*nid, session.addr.clone(), session.attempts()));
                    }
                }
            }