Always set the channel corresponding to a node ()

This commit is contained in:
GUVWAF 2024-11-09 04:30:12 +01:00 committed by GitHub
parent 2c2213ef9b
commit 893efe4f11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,9 +187,10 @@ ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
handleReceived(p, src);
}
if (!p->channel && !p->pki_encrypted) { // don't override if a channel was requested
// don't override if a channel was requested and no need to set it when PKI is enforced
if (!p->channel && !p->pki_encrypted) {
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(p->to);
if (node && node->user.public_key.size == 0) {
if (node) {
p->channel = node->channel;
LOG_DEBUG("localSend to channel %d", p->channel);
}