Skip to content

Commit 6238da0

Browse files
committed
Address comments
1 parent a139336 commit 6238da0

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

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

11311131
auto entry = findSessionKey(contact.id.pub_key);
11321132

@@ -1361,9 +1361,9 @@ void BaseChatMesh::onSessionKeyDecryptSuccess(int peer_idx) {
13611361
if (changed) {
13621362
memset(entry->prev_session_key, 0, SESSION_KEY_SIZE);
13631363
entry->state = SESSION_STATE_ACTIVE;
1364+
onSessionKeysUpdated();
13641365
}
13651366
entry->sends_since_last_recv = 0;
1366-
if (changed) onSessionKeysUpdated();
13671367
}
13681368
}
13691369
}

0 commit comments

Comments
 (0)