Skip to content

Commit 1f4cee2

Browse files
committed
Address comments
1 parent b35914f commit 1f4cee2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
145145
// FUTURE: could send back multiple paths, using createPathReturn(), and let sender choose which to use(?)
146146

147147
if (self_id.isHashMatch(&dest_hash)) {
148-
// scan contacts DB, for all matching hashes of 'src_hash' (max 4 matches supported ATM)
148+
// scan contacts DB, for all matching hashes of 'src_hash' (max 8 matches supported ATM)
149149
int num = searchPeersByHash(&src_hash);
150150
// for each matching contact, try to decrypt data
151151
bool found = false;

src/helpers/BaseChatMesh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ bool BaseChatMesh::shouldInitiateSessionKey(const ContactInfo& contact) {
12081208
if (!(contact.flags & CONTACT_FLAG_AEAD)) return false;
12091209

12101210
// Need a known path to send the request
1211-
if (contact.out_path_len < 0) return false;
1211+
if (contact.out_path_len == OUT_PATH_UNKNOWN) return false;
12121212

12131213
auto entry = findSessionKey(contact.id.pub_key);
12141214

@@ -1443,9 +1443,9 @@ void BaseChatMesh::onSessionKeyDecryptSuccess(int peer_idx) {
14431443
if (changed) {
14441444
memset(entry->prev_session_key, 0, SESSION_KEY_SIZE);
14451445
entry->state = SESSION_STATE_ACTIVE;
1446+
onSessionKeysUpdated();
14461447
}
14471448
entry->sends_since_last_recv = 0;
1448-
if (changed) onSessionKeysUpdated();
14491449
}
14501450
}
14511451
}

0 commit comments

Comments
 (0)