fix: remove double-hashing in _compute_identity_hash()

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 <noreply@anthropic.com>
This commit is contained in:
torlando-tech 2025-12-29 22:08:34 -05:00
commit 0b946a804d

View file

@ -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"):
"""