mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
clef: don't error is pcsc is not installed
This commit is contained in:
parent
22d03be930
commit
b0d66c994c
1 changed files with 14 additions and 3 deletions
|
|
@ -22,6 +22,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -156,12 +157,22 @@ func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath str
|
||||||
|
|
||||||
// Start a smart card hub
|
// Start a smart card hub
|
||||||
if len(scpath) > 0 {
|
if len(scpath) > 0 {
|
||||||
|
// Sanity check that the smartcard path is valid
|
||||||
|
fi, err := os.Stat(scpath)
|
||||||
|
if err != nil {
|
||||||
|
log.Info("Smartcard socket file missing, disabling", "err", err)
|
||||||
|
} else {
|
||||||
|
if fi.Mode()&os.ModeType != os.ModeSocket {
|
||||||
|
log.Error("Invalid smartcard socket file type", "path", scpath, "type", fi.Mode().String())
|
||||||
|
} else {
|
||||||
if schub, err := scwallet.NewHub(scpath, scwallet.Scheme, ksLocation); err != nil {
|
if schub, err := scwallet.NewHub(scpath, scwallet.Scheme, ksLocation); err != nil {
|
||||||
log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err))
|
log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err))
|
||||||
} else {
|
} else {
|
||||||
backends = append(backends, schub)
|
backends = append(backends, schub)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clef doesn't allow insecure http account unlock.
|
// Clef doesn't allow insecure http account unlock.
|
||||||
return accounts.NewManager(&accounts.Config{InsecureUnlockAllowed: false}, backends...)
|
return accounts.NewManager(&accounts.Config{InsecureUnlockAllowed: false}, backends...)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue