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
// ATM, we require to one and only one trezor device to be connected.
47
+
// The support of multiple trezor devices is not implemented, yet.
48
+
iflen(trezors) ==0 {
49
+
tlog.Fatal.Printf("Trezor device is not found. Check the connection.")
50
+
os.Exit(exitcodes.TrezorError)
51
+
}
52
+
iflen(trezors) >1 {
53
+
tlog.Fatal.Printf("It's more than one Trezor device connected. This case is not implemented, yet. The number of currently connected devices: %v.", len(trezors))
54
+
os.Exit(exitcodes.TrezorError)
55
+
}
56
+
57
+
// Using the first found device
58
+
trezor:=trezors[0]
59
+
60
+
// Trezor may ask for PIN or Passphrase. Setting the handler for this case.
61
+
trezor.SetGetPinFunc(trezorGetPin)
62
+
63
+
// In some cases (like lost connection to the Trezor device and cannot
64
+
// reconnect) it's required to get a confirmation from the user to
65
+
// retry to reconnect. Setting the handler for this case.
66
+
trezor.SetGetConfirmFunc(trezorGetConfirm)
67
+
68
+
// To reset the state of the device and check if it's initialized.
69
+
// If device is not initialized then trezor.Reset() will return an
70
+
// error.
71
+
err:=trezor.Reset()
29
72
iferr!=nil {
30
-
tlog.Fatal.Printf("xxx some error was encountered...")
73
+
tlog.Fatal.Printf("Cannot reset the Trezor device. Error: %v", err.Error())
0 commit comments