mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 23:35:45 +00:00
* workaround for TRACE packets so they can follow a return path
This commit is contained in:
@@ -14,6 +14,9 @@ void Packet::calculatePacketHash(uint8_t* hash) const {
|
||||
SHA256 sha;
|
||||
uint8_t t = getPayloadType();
|
||||
sha.update(&t, 1);
|
||||
if (t == PAYLOAD_TYPE_TRACE) {
|
||||
sha.update(&path_len, sizeof(path_len)); // CAVEAT: TRACE packets can revisit same node on return path
|
||||
}
|
||||
sha.update(payload, payload_len);
|
||||
sha.finalize(hash, MAX_HASH_SIZE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user