remove the noise handshake if peer goes offline (#435)

This commit is contained in:
callebtc
2025-09-15 15:33:39 +02:00
committed by GitHub
parent 7061a96cce
commit 1178fc254a
2 changed files with 18 additions and 3 deletions
@@ -150,6 +150,13 @@ class BluetoothMeshService(private val context: Context) {
}
override fun onPeerRemoved(peerID: String) {
try { gossipSyncManager.removeAnnouncementForPeer(peerID) } catch (_: Exception) { }
// Also drop any Noise session state for this peer when they go offline
try {
encryptionService.removePeer(peerID)
Log.d(TAG, "Removed Noise session for offline peer $peerID")
} catch (e: Exception) {
Log.w(TAG, "Failed to remove Noise session for $peerID: ${e.message}")
}
}
}