-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description --- If the HidApi disconnects, the instance will still exist but can no longer be used. We need a new instance, but only a single one can exist at a time. So we're locking it in a mutex to ensure mutable safety. Then if at some point communication errors because the instance is stale we will drop the existing instance by re-assignment of the inner struct field, and create a new working instance. Motivation and Context --- Allow someone with an open console wallet to be able to connect and disconnect their ledger at will. Without the need to restart the wallet. If the connection to the ledger fails, it will re-establish the connection (only one attempt) and then proceed. How Has This Been Tested? --- Manually with the console wallet. Using the ledger demo test file it *mostly* works but there's a weird error return on the reconnection of the ledger before opening the Tari app that could also use some more debugging. What process can a PR reviewer use to test or verify this change? --- - Open a console wallet supported by ledger - Make a transaction successfully - Unplug the ledger - Make a failed transaction because the ledger is missing - Plug the ledger back in - Make a transaction successfully Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify
- Loading branch information
Showing
3 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters