From 765fc48c8496b35717a53405d745b154fc655955 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Mon, 24 Jun 2024 14:29:00 +0200 Subject: [PATCH] node: Fix edge case in persistent peer connections If two peers are persistent for each other and experience disconnections, it's possible that an outbound connection is turned into an inbound one. But if we don't set that correctly, we'll eventually run into a crash where an already connected peer re-connects, since the disconnection logic checks for the link direction. --- radicle-node/src/service.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index 0b66b3b9..1d8575a5 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -1340,6 +1340,7 @@ where target: "service", "Connecting peer {remote} already has a session open ({peer})" ); + peer.link = link; peer.to_connected(self.clock); self.outbox.write_all(peer, msgs); }