Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Call service on failed connection attempt
Alexis Sellier committed 3 years ago
commit 94427ee22ba796cde7b065975545e9439b13d3d4
parent 29b933e485c3950ebc9d51538a81a222558a2a51
1 file changed +7 -2
modified radicle-node/src/wire/protocol.rs
@@ -121,11 +121,14 @@ impl Peer {
    /// Return the peer's id, if any.
    fn id(&self) -> Option<&NodeId> {
        match self {
-
            Peer::Connected { id, .. }
+
            Peer::Outbound { id }
+
            | Peer::Connected { id, .. }
            | Peer::Disconnected { id: Some(id), .. }
            | Peer::Upgrading { id, .. }
            | Peer::Upgraded { id, .. } => Some(id),
-
            _ => None,
+

+
            Peer::Inbound {} => None,
+
            Peer::Disconnected { id: None, .. } => None,
        }
    }

@@ -592,6 +595,8 @@ where

                        if let Some(id) = peer.id() {
                            self.service.disconnected(*id, &reason);
+
                        } else {
+
                            log::debug!(target: "wire", "Inbound disconnection before handshake; ignoring..")
                        }
                        peer.disconnected(reason);
                    }