diff options
Diffstat (limited to 'OnionRouter.hs')
-rw-r--r-- | OnionRouter.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/OnionRouter.hs b/OnionRouter.hs index 40112e6a..04df18b6 100644 --- a/OnionRouter.hs +++ b/OnionRouter.hs | |||
@@ -33,7 +33,7 @@ newtype RouteId = RouteId Int | |||
33 | deriving Show | 33 | deriving Show |
34 | 34 | ||
35 | data OnionRouter = OnionRouter | 35 | data OnionRouter = OnionRouter |
36 | { pendingQueries :: TVar (Word64Map NodeId) -- TODO: routeNonce belongs here instead of in routeMap, or just remove routeNonce and use transaction nonce. | 36 | { pendingQueries :: TVar (Word64Map NodeId) |
37 | , routeMap :: TVar (IntMap RouteRecord) | 37 | , routeMap :: TVar (IntMap RouteRecord) |
38 | , trampolineNodes :: TVar (IntMap NodeInfo) | 38 | , trampolineNodes :: TVar (IntMap NodeInfo) |
39 | , trampolineIds :: TVar (HashMap NodeId Int) | 39 | , trampolineIds :: TVar (HashMap NodeId Int) |
@@ -201,7 +201,6 @@ handleEvent getnodes or e@(BuildRoute (RouteId rid)) = do | |||
201 | drg <- readTVar (onionDRG or) | 201 | drg <- readTVar (onionDRG or) |
202 | [av,bv,cv] <- sequence $ replicate 3 (newTVar Nothing) | 202 | [av,bv,cv] <- sequence $ replicate 3 (newTVar Nothing) |
203 | let (getr, drg') = withDRG drg $ do | 203 | let (getr, drg') = withDRG drg $ do |
204 | n24 <- Nonce24 <$> getRandomBytes 24 | ||
205 | asec <- generateSecretKey -- Three aliases | 204 | asec <- generateSecretKey -- Three aliases |
206 | bsec <- generateSecretKey | 205 | bsec <- generateSecretKey |
207 | csec <- generateSecretKey | 206 | csec <- generateSecretKey |
@@ -233,8 +232,7 @@ handleEvent getnodes or e@(BuildRoute (RouteId rid)) = do | |||
233 | [a,b,c] | distinct3by nodeClass a b c -> do | 232 | [a,b,c] | distinct3by nodeClass a b c -> do |
234 | atomically $ writeTChan (routeLog or) $ unwords [ "ONION using route:", show $ nodeAddr a, show $ nodeAddr b, show $ nodeAddr c] | 233 | atomically $ writeTChan (routeLog or) $ unwords [ "ONION using route:", show $ nodeAddr a, show $ nodeAddr b, show $ nodeAddr c] |
235 | return $ Just OnionRoute | 234 | return $ Just OnionRoute |
236 | { routeNonce = n24 | 235 | { routeAliasA = asec |
237 | , routeAliasA = asec | ||
238 | , routeAliasB = bsec | 236 | , routeAliasB = bsec |
239 | , routeAliasC = csec | 237 | , routeAliasC = csec |
240 | , routeNodeA = a | 238 | , routeNodeA = a |