diff --git a/lib/crypto/index.js b/lib/crypto/index.js index bbb3561a6..07e06eb22 100644 --- a/lib/crypto/index.js +++ b/lib/crypto/index.js @@ -172,6 +172,9 @@ Crypto.prototype.uploadKeys = function(maxKeys) { // Try to keep at most half that number on the server. This leaves the // rest of the slots free to hold keys that have been cliamed from the // server but we haven't recevied a message for. + // If we run out of slots when generating new keys then olm will + // discard the oldest private keys first. This will eventually clean + // out stale private keys that won't receive a message. var keyLimit = Math.floor(maxOneTimeKeys / 2); // We work out how many new keys we need to create to top up the server // If there are too many keys on the server then we don't need to