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.
This commit is contained in:
cloudhead 2024-06-24 14:29:00 +02:00
parent c94ce020a1
commit 765fc48c84
No known key found for this signature in database
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}