summaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-11-05 17:10:50 -0500
committerjoe <joe@jerkface.net>2017-11-05 17:10:50 -0500
commiteed5ae421e6e0e57ba4259cc4b4c8b132d643aa2 (patch)
tree989ee0b1dd557d931ec59817f8a37c2063aaef95 /src/Crypto
parent0658b07e68eed370c790f74db7d67f1496134b43 (diff)
Use insert instead of insertTake when updating a timestamp on a cached
secret.
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/Tox.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs
index 7cfbd193..f427421e 100644
--- a/src/Crypto/Tox.hs
+++ b/src/Crypto/Tox.hs
@@ -306,7 +306,7 @@ lookupSharedSecret TransportCrypto{secretsCache} sk recipient nonce = do
306 let (r,v) = case MM.lookup' sk smm of 306 let (r,v) = case MM.lookup' sk smm of
307 Nothing | let miss = computeSharedSecret sk recipient 307 Nothing | let miss = computeSharedSecret sk recipient
308 -> (miss, MM.insertTake' 3 sk miss (Down now) smm) 308 -> (miss, MM.insertTake' 3 sk miss (Down now) smm)
309 Just (stamp2,hit) -> (hit , MM.insertTake' 3 sk hit (Down now) smm) 309 Just (stamp2,hit) -> (hit , MM.insert' sk hit (Down now) smm)
310 writeTVar (sharedSecret secretsCache) 310 writeTVar (sharedSecret secretsCache)
311 (MM.insertTake' 160 recipient v (Down now) mm) 311 (MM.insertTake' 160 recipient v (Down now) mm)
312 return $ r nonce 312 return $ r nonce