summaryrefslogtreecommitdiff
path: root/main/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-06-01 17:39:58 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-06-03 23:07:55 +0200
commitb810f2dab0040e9c5a9f2344ecda67e5817893f5 (patch)
tree7cc0f296105631c261a148935fcb94de2dac2505 /main/Main.hs
parentbd3e57cdba7db5e2a70308b18e2b47638fc566fd (diff)
Discovery search using global state to ask new peers
Diffstat (limited to 'main/Main.hs')
-rw-r--r--main/Main.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/main/Main.hs b/main/Main.hs
index e9c0ae4..26f4b12 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -923,16 +923,11 @@ cmdDiscoveryInit = void $ do
cmdDiscovery :: Command
cmdDiscovery = void $ do
- Just peer <- gets csIcePeer
+ server <- asks ciServer
sref <- asks ciLine
- eprint <- asks ciPrint
case readRefDigest (BC.pack sref) of
Nothing -> throwOtherError "failed to parse ref"
- Just dgst -> liftIO $ do
- res <- runExceptT $ sendToPeer peer $ DiscoverySearch $ Right dgst
- case res of
- Right _ -> return ()
- Left err -> eprint err
+ Just dgst -> discoverySearch server dgst
#ifdef ENABLE_ICE_SUPPORT