forked from cerc-io/plugeth
cmd, miner, signer: avoid panic if keystore is not available (#27039)
* cmd, miner, singer: avoid panic if keystore is not available * cmd/geth: print warning instead of panic
This commit is contained in:
@@ -111,7 +111,11 @@ func (s *UIServerAPI) DeriveAccount(url string, path string, pin *bool) (account
|
||||
|
||||
// fetchKeystore retrieves the encrypted keystore from the account manager.
|
||||
func fetchKeystore(am *accounts.Manager) *keystore.KeyStore {
|
||||
return am.Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
|
||||
ks := am.Backends(keystore.KeyStoreType)
|
||||
if len(ks) == 0 {
|
||||
return nil
|
||||
}
|
||||
return ks[0].(*keystore.KeyStore)
|
||||
}
|
||||
|
||||
// ImportRawKey stores the given hex encoded ECDSA key into the key directory,
|
||||
|
||||
Reference in New Issue
Block a user