diff options
author | Joe Crayne <joe@jerkface.net> | 2018-06-28 19:22:00 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-06-28 19:23:14 -0400 |
commit | 8b817ae44034b5a0740df369c002e8953a530840 (patch) | |
tree | b8b8bac5d75d3421b22d861b8c95d8394e6eeebb /src/Network | |
parent | 8ff122d2d381fc9b1dd5c16067fba19f89512261 (diff) |
More performant pendingRoutes (IntMap -> Array).
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/Tox/Onion/Transport.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index e2e136ae..7ed9702a 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs | |||
@@ -250,12 +250,9 @@ encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do | |||
250 | req <- wrapForRoute crypto msg ni route | 250 | req <- wrapForRoute crypto msg ni route |
251 | return ( runPut $ putRequest req | 251 | return ( runPut $ putRequest req |
252 | , nodeAddr $ routeNodeA route) | 252 | , nodeAddr $ routeNodeA route) |
253 | mapM' f x = do | 253 | m <- {-# SCC "encodeOnionAddr.getRoute" #-} getRoute ni rid |
254 | let _ = x :: Maybe OnionRoute | 254 | x <- {-# SCC "encodeOnionAddr.wrapForRoute" #-} mapM go m |
255 | -- dput XMisc $ "ONION encode sending to " ++ show ni | 255 | return x |
256 | -- dput XMisc $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) | ||
257 | mapM f x -- ONION encode getRoute -> Nothing | ||
258 | getRoute ni rid >>= mapM' go | ||
259 | 256 | ||
260 | 257 | ||
261 | forwardOnions :: TransportCrypto -> UDPTransport -> UDPTransport | 258 | forwardOnions :: TransportCrypto -> UDPTransport -> UDPTransport |