summaryrefslogtreecommitdiff
path: root/dht/HandshakeCache.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-12-13 12:04:55 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-01 23:26:05 -0500
commita62e3c8691cfb07276d334274161afb8bc253f3f (patch)
tree441729a581380b796365ef99b9d0e22a0882d619 /dht/HandshakeCache.hs
parentb675708ddb86efcdb2000c5e4b152d7744cbe16f (diff)
wip: connect via tcp.
Diffstat (limited to 'dht/HandshakeCache.hs')
-rw-r--r--dht/HandshakeCache.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/dht/HandshakeCache.hs b/dht/HandshakeCache.hs
index 61735e8a..91f5faaf 100644
--- a/dht/HandshakeCache.hs
+++ b/dht/HandshakeCache.hs
@@ -113,13 +113,13 @@ cacheHandshake hscache me them their_node ecookie = do
113 dput XNetCrypto $ "cacheHandshake " ++ show (key2id them,ecookie) 113 dput XNetCrypto $ "cacheHandshake " ++ show (key2id them,ecookie)
114 atomically $ snd <$> cacheHandshakeSTM hscache me them their_node ecookie timestamp 114 atomically $ snd <$> cacheHandshakeSTM hscache me them their_node ecookie timestamp
115 115
116haveCachedCookie :: HandshakeCache 116getPendingCookieFlag :: HandshakeCache
117 -> PublicKey 117 -> PublicKey
118 -> PublicKey 118 -> PublicKey
119 -> STM Bool 119 -> STM Bool
120haveCachedCookie hscache me them = do 120getPendingCookieFlag hscache me them = do
121 m <- Map.lookup (me,them) <$> readTVar (hscPendingCookies hscache) 121 m <- Map.lookup (me,them) <$> readTVar (hscPendingCookies hscache)
122 return $ maybe True (const False) m 122 return $ maybe False (const True) m
123 123
124 124
125setPendingCookie :: HandshakeCache 125setPendingCookie :: HandshakeCache