Skip to content

Commit cffd755

Browse files
committed
Address comments
1 parent bad2d70 commit cffd755

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Mesh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
138138
// FUTURE: could send back multiple paths, using createPathReturn(), and let sender choose which to use(?)
139139

140140
if (self_id.isHashMatch(&dest_hash)) {
141-
// scan contacts DB, for all matching hashes of 'src_hash' (max 4 matches supported ATM)
141+
// scan contacts DB, for all matching hashes of 'src_hash' (max 8 matches supported ATM)
142142
int num = searchPeersByHash(&src_hash);
143143
// for each matching contact, try to decrypt data
144144
bool found = false;
@@ -274,7 +274,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
274274
if (i + 2 >= pkt->payload_len) {
275275
MESH_DEBUG_PRINTLN("%s Mesh::onRecvPacket(): incomplete data packet", getLogDateTime());
276276
} else if (!_tables->hasSeen(pkt)) {
277-
// scan channels DB, for all matching hashes of 'channel_hash' (max 4 matches supported ATM)
277+
// scan channels DB, for all matching hashes of 'channel_hash' (max 8 matches supported ATM)
278278
GroupChannel channels[4];
279279
int num = searchChannelsByHash(&channel_hash, channels, 4);
280280
// for each matching channel, try to decrypt data

src/helpers/BaseChatMesh.cpp

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

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

12011201
auto entry = findSessionKey(contact.id.pub_key);
12021202

@@ -1431,9 +1431,9 @@ void BaseChatMesh::onSessionKeyDecryptSuccess(int peer_idx) {
14311431
if (changed) {
14321432
memset(entry->prev_session_key, 0, SESSION_KEY_SIZE);
14331433
entry->state = SESSION_STATE_ACTIVE;
1434+
onSessionKeysUpdated();
14341435
}
14351436
entry->sends_since_last_recv = 0;
1436-
if (changed) onSessionKeysUpdated();
14371437
}
14381438
}
14391439
}

0 commit comments

Comments
 (0)