From 0b946a804d9b855d80b803de29a7d4e9a4cd2cc5 Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Mon, 29 Dec 2025 22:08:34 -0500 Subject: [PATCH] fix: remove double-hashing in _compute_identity_hash() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The peer_identity parameter is already the identity hash received from the BLE handshake. Calling RNS.Identity.full_hash() on it again produced a completely different value, causing identity mismatch between peers. This caused "no reassembler for X" errors because the sending peer's identity didn't match what the receiving peer computed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/RNS/Interfaces/BLEInterface.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/RNS/Interfaces/BLEInterface.py b/src/RNS/Interfaces/BLEInterface.py index 44f9bb8..293699e 100644 --- a/src/RNS/Interfaces/BLEInterface.py +++ b/src/RNS/Interfaces/BLEInterface.py @@ -1450,15 +1450,17 @@ class BLEInterface(Interface): def _compute_identity_hash(self, peer_identity): """ - Compute 16-character hex identity hash for interface tracking. + Convert 16-byte identity to 16-character hex string for interface tracking. Args: - peer_identity: 16-byte peer identity + peer_identity: 16-byte peer identity (already a hash from BLE handshake) Returns: - str: Identity hash (16 hex chars) + str: First 16 hex chars of identity (8 bytes) """ - return RNS.Identity.full_hash(peer_identity)[:16].hex()[:16] + # peer_identity is already the identity hash from BLE handshake + # Just convert to hex, don't re-hash (that would corrupt the identity!) + return peer_identity.hex()[:16] def _spawn_peer_interface(self, address, name, peer_identity, client=None, mtu=None, connection_type="central"): """