Skip to content

Commit 8ae955c

Browse files
committed
Address comments
1 parent 54c4718 commit 8ae955c

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
@@ -1117,7 +1117,7 @@ bool BaseChatMesh::shouldInitiateSessionKey(const ContactInfo& contact) {
11171117
if (!(contact.flags & CONTACT_FLAG_AEAD)) return false;
11181118

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

11221122
auto entry = findSessionKey(contact.id.pub_key);
11231123

@@ -1352,9 +1352,9 @@ void BaseChatMesh::onSessionKeyDecryptSuccess(int peer_idx) {
13521352
if (changed) {
13531353
memset(entry->prev_session_key, 0, SESSION_KEY_SIZE);
13541354
entry->state = SESSION_STATE_ACTIVE;
1355+
onSessionKeysUpdated();
13551356
}
13561357
entry->sends_since_last_recv = 0;
1357-
if (changed) onSessionKeysUpdated();
13581358
}
13591359
}
13601360
}

0 commit comments

Comments
 (0)