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
|
return err
|
||||||
}
|
}
|
||||||
// Only return the PIN request if the device wasn't unlocked until now
|
// Only return the PIN request if the device wasn't unlocked until now
|
||||||
if res == 2 {
|
switch res {
|
||||||
return nil // Device responded with trezor.Success
|
case 0:
|
||||||
}
|
|
||||||
if res == 0 {
|
|
||||||
w.pinwait = true
|
w.pinwait = true
|
||||||
return ErrTrezorPINNeeded
|
return ErrTrezorPINNeeded
|
||||||
} else if res == 1 {
|
case 1:
|
||||||
w.pinwait = false
|
w.pinwait = false
|
||||||
w.passphrasewait = true
|
w.passphrasewait = true
|
||||||
return ErrTrezorPassphraseNeeded
|
return ErrTrezorPassphraseNeeded
|
||||||
|
case 2:
|
||||||
|
return nil // responded with trezor.Success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Phase 2 requested with actual PIN entry
|
// Phase 2 requested with actual PIN entry
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue