You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the resident process called close(), cpu utilization exceeds 100%
2.we found a possible code:
` ledger_hid.go
func (ledger *LedgerDeviceHID) readThread() {
defer close(ledger.readChannel)
for {
buffer := make([]byte, PacketSize)
readBytes, err := ledger.device.Read(buffer)
// Check for HID Read Error (May occur even during normal runtime)
if err != nil {
continue
}
// Discard all zero packets from Ledger Nano X on macOS
allZeros := true
for i := 0; i < len(buffer); i++ {
if buffer[i] != 0 {
allZeros = false
break
}
}
// Discard all zero packet
if allZeros {
// HID Returned Empty Packet - Retry Read
continue
}
select {
case ledger.readChannel <- buffer[:readBytes]:
// Send data to UnwrapResponseAPDU
default:
// Possible source of bugs
// Drop a buffer if ledger.readChannel is busy
}
}
}
`
The text was updated successfully, but these errors were encountered:
2.we found a possible code:
` ledger_hid.go
}
`
The text was updated successfully, but these errors were encountered: