diff options
author | joe <joe@jerkface.net> | 2017-11-03 23:20:17 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-03 23:20:17 -0400 |
commit | 133d40e02714e75b9f528314280f7348da6bba87 (patch) | |
tree | 481730a37b280ba793d1701549a31b140a6ede21 /src/Network/Tox.hs | |
parent | b3f55f54aa7eb2c7cc62979781b4dd8b3d359f89 (diff) |
Added --dhtkey option.
Diffstat (limited to 'src/Network/Tox.hs')
-rw-r--r-- | src/Network/Tox.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index 6f591917..9f41fbe5 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -282,12 +282,18 @@ getOnionAlias crypto dhtself remoteNode = atomically $ do | |||
282 | return $ Onion.OnionDestination Onion.SearchingAlias alias Nothing | 282 | return $ Onion.OnionDestination Onion.SearchingAlias alias Nothing |
283 | 283 | ||
284 | 284 | ||
285 | newTox :: TVar Onion.AnnouncedKeys -> SockAddr -> Maybe NetCryptoSessions -> IO Tox | 285 | newTox :: TVar Onion.AnnouncedKeys -> SockAddr -> Maybe NetCryptoSessions -> Maybe SecretKey -> IO Tox |
286 | newTox keydb addr mbSessionsState = do | 286 | newTox keydb addr mbSessionsState suppliedDHTKey = do |
287 | udp <- addVerbosity <$> udpTransport addr | 287 | udp <- addVerbosity <$> udpTransport addr |
288 | (crypto,sessionsState) <- case mbSessionsState of | 288 | (crypto,sessionsState) <- case mbSessionsState of |
289 | Nothing -> do | 289 | Nothing -> do |
290 | crypto <- newCrypto | 290 | crypto0 <- newCrypto |
291 | let crypto = fromMaybe crypto0 $do | ||
292 | k <- suppliedDHTKey | ||
293 | return crypto0 | ||
294 | { transportSecret = k | ||
295 | , transportPublic = toPublic k | ||
296 | } | ||
291 | sessionsState <- newSessionsState crypto defaultUnRecHook defaultCryptoDataHooks | 297 | sessionsState <- newSessionsState crypto defaultUnRecHook defaultCryptoDataHooks |
292 | return (crypto,sessionsState) | 298 | return (crypto,sessionsState) |
293 | Just s -> return (transportCrypto s, s) | 299 | Just s -> return (transportCrypto s, s) |