Purge key by keyID before persisting new key

This commit is contained in:
Tankred Hase 2016-06-14 10:42:53 +02:00
parent d4c1e7ba06
commit e09454242d

View File

@ -88,7 +88,7 @@ class PublicKey {
*/
*_persisKey(key) {
// delete old/unverified key
yield this._mongo.remove({ fingerprint:key.fingerprint }, DB_TYPE);
yield this._mongo.remove({ keyId:key.keyId }, DB_TYPE);
// generate nonces for verification
for (let uid of key.userIds) {
uid.nonce = util.random();