diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/Main.hs | 4 | ||||
-rw-r--r-- | main/Test.hs | 5 |
2 files changed, 3 insertions, 6 deletions
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 diff --git a/main/Test.hs b/main/Test.hs index 0181575..75eaaaf 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -880,8 +880,5 @@ cmdDiscoveryConnect = do st <- asks tiStorage [ tref ] <- asks tiParams Just ref <- liftIO $ readRef st $ encodeUtf8 tref - Just RunningServer {..} <- gets tsServer - peers <- liftIO $ getCurrentPeerList rsServer - forM_ peers $ \peer -> do - sendToPeer peer $ DiscoverySearch ref + discoverySearch rsServer ref |