Browse Source

prevent rekeying wrong contact

pull/1677/head
Wessel Nieboer 5 months ago
parent
commit
b3c4adada1
No known key found for this signature in database GPG Key ID: 929C8E45E33B5FD2
  1. 4
      src/helpers/BaseChatMesh.cpp

4
src/helpers/BaseChatMesh.cpp

@ -993,6 +993,10 @@ bool BaseChatMesh::removeContact(ContactInfo& contact) {
removeSessionKey(contact.id.pub_key); // also remove session key if any
// adjust pending rekey index before shifting array
if (_pending_rekey_idx == idx) _pending_rekey_idx = -1;
else if (_pending_rekey_idx > idx) _pending_rekey_idx--;
// remove from contacts array and parallel nonce tracking
num_contacts--;
while (idx < num_contacts) {

Loading…
Cancel
Save