diff options
author | joe <joe@jerkface.net> | 2017-11-05 17:10:50 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-05 17:10:50 -0500 |
commit | eed5ae421e6e0e57ba4259cc4b4c8b132d643aa2 (patch) | |
tree | 989ee0b1dd557d931ec59817f8a37c2063aaef95 /src/Crypto | |
parent | 0658b07e68eed370c790f74db7d67f1496134b43 (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.hs | 2 |
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 |