trezor / trezord-go

:smiling_imp: Trezor Communication Daemon (written in Go)
GNU Lesser General Public License v3.0
245 stars 146 forks source link

Finishing reading when read canceled #156

Closed karelbilek closed 2 years ago

karelbilek commented 5 years ago

Fixes https://github.com/trezor/trezord-go/issues/154 , but the resulting code is so complex that I am not sure it's worth this.

(Since it will probably have bugs because of the complexity.)

Tested on UDP and Trezor T2.

Depends on https://github.com/trezor/trezord-go/pull/153 (so see just the last commit for actual changes)

(Note that UDP emulator will hang, but that's not the issue of this fix. If we want to fix the hang/the black screen, we would also need to send empty Initialize after the read here, and then read the result.)