mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
accounts/usbwallet: add switch
This commit is contained in:
parent
912f5f87fb
commit
6783a06307
1 changed files with 5 additions and 5 deletions
|
|
@ -118,16 +118,16 @@ func (w *trezorDriver) Open(device io.ReadWriter, passphrase string) error {
|
|||
return err
|
||||
}
|
||||
// Only return the PIN request if the device wasn't unlocked until now
|
||||
if res == 2 {
|
||||
return nil // Device responded with trezor.Success
|
||||
}
|
||||
if res == 0 {
|
||||
switch res {
|
||||
case 0:
|
||||
w.pinwait = true
|
||||
return ErrTrezorPINNeeded
|
||||
} else if res == 1 {
|
||||
case 1:
|
||||
w.pinwait = false
|
||||
w.passphrasewait = true
|
||||
return ErrTrezorPassphraseNeeded
|
||||
case 2:
|
||||
return nil // responded with trezor.Success
|
||||
}
|
||||
}
|
||||
// Phase 2 requested with actual PIN entry
|
||||
|
|
|
|||
Loading…
Reference in a new issue