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"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
|
|
@ -156,10 +157,20 @@ func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath str
|
|||
|
||||
// Start a smart card hub
|
||||
if len(scpath) > 0 {
|
||||
if schub, err := scwallet.NewHub(scpath, scwallet.Scheme, ksLocation); err != nil {
|
||||
log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err))
|
||||
// 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 {
|
||||
backends = append(backends, schub)
|
||||
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 {
|
||||
log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err))
|
||||
} else {
|
||||
backends = append(backends, schub)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue