diff options
author | Joe Crayne <joe@jerkface.net> | 2019-12-13 12:04:55 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-01 23:26:05 -0500 |
commit | a62e3c8691cfb07276d334274161afb8bc253f3f (patch) | |
tree | 441729a581380b796365ef99b9d0e22a0882d619 /dht/HandshakeCache.hs | |
parent | b675708ddb86efcdb2000c5e4b152d7744cbe16f (diff) |
wip: connect via tcp.
Diffstat (limited to 'dht/HandshakeCache.hs')
-rw-r--r-- | dht/HandshakeCache.hs | 6 |
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 | ||
116 | haveCachedCookie :: HandshakeCache | 116 | getPendingCookieFlag :: HandshakeCache |
117 | -> PublicKey | 117 | -> PublicKey |
118 | -> PublicKey | 118 | -> PublicKey |
119 | -> STM Bool | 119 | -> STM Bool |
120 | haveCachedCookie hscache me them = do | 120 | getPendingCookieFlag 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 | ||
125 | setPendingCookie :: HandshakeCache | 125 | setPendingCookie :: HandshakeCache |