From d323c4fbf5fa8a9e4d6cb243e69647f00bbc8668 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Smr=C5=BE?= <roman.smrz@seznam.cz>
Date: Thu, 27 Mar 2025 22:32:13 +0100
Subject: Discovery: always relay connection request if possible

---
 src/Erebos/Discovery.hs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Erebos/Discovery.hs b/src/Erebos/Discovery.hs
index 15ac9c4..f156c85 100644
--- a/src/Erebos/Discovery.hs
+++ b/src/Erebos/Discovery.hs
@@ -300,11 +300,10 @@ instance Service DiscoveryService where
                     mbdp <- M.lookup (refDigest $ dconnTarget conn) <$> svcGetGlobal
                     case mbdp of
                         Nothing -> replyPacket $ DiscoveryConnectionResponse rconn
-                        Just dp | addr : _ <- dpAddress dp -> do
-                                    replyPacket $ DiscoveryConnectionResponse rconn { dconnAddress = Just addr }
-                                | Just dpeer <- dpPeer dp -> do
-                                    sendToPeer dpeer $ DiscoveryConnectionRequest conn
-                                | otherwise -> svcPrint $ "Discovery: failed to relay connection request"
+                        Just dp
+                            | Just dpeer <- dpPeer dp -> do
+                                sendToPeer dpeer $ DiscoveryConnectionRequest conn
+                            | otherwise -> svcPrint $ "Discovery: failed to relay connection request"
 
         DiscoveryConnectionResponse conn -> do
             self <- svcSelf
-- 
cgit v1.2.3