From e8f3cbe08071c0507abafa76d0bf9d32908bbd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 1 Jun 2025 17:39:58 +0200 Subject: Discovery search using global state to ask new peers --- main/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/Main.hs') diff --git a/main/Main.hs b/main/Main.hs index e055275..59ea7c3 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -893,14 +893,14 @@ cmdDiscoveryInit = void $ do cmdDiscovery :: Command cmdDiscovery = void $ do - Just peer <- gets csIcePeer + server <- asks ciServer st <- getStorage sref <- asks ciLine eprint <- asks ciPrint liftIO $ readRef st (BC.pack sref) >>= \case Nothing -> error "ref does not exist" Just ref -> do - res <- runExceptT $ sendToPeer peer $ DiscoverySearch ref + res <- runExceptT $ discoverySearch server ref case res of Right _ -> return () Left err -> eprint err -- cgit v1.2.3