flags: disallow --dev in combo with --externalsigner

This commit is contained in:
Martin Holst Swende 2018-12-06 15:03:42 +01:00
parent d716bd57d0
commit 762482ef2c
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 5 additions and 1 deletions

View file

@ -1174,7 +1174,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag)
checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")
// Can't use both ephemeral unlocked and external signer
checkExclusive(ctx, DeveloperFlag, ExternalSignerFlag)
var ks *keystore.KeyStore
if keystores := stack.AccountManager().Backends(keystore.KeyStoreType); len(keystores) > 0 {
ks = keystores[0].(*keystore.KeyStore)

View file

@ -436,8 +436,11 @@ func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
// Assemble the account manager and supported backends
backends := []accounts.Backend{}
if len(conf.ExternalSigner) > 0 {
log.Info("Using external signer", "url", conf.ExternalSigner)
if extapi, err := external.NewExternalBackend(conf.ExternalSigner); err == nil {
backends = append(backends, extapi)
} else {
log.Info("Error configuring external signer", "error", err)
}
}
if len(backends) == 0 {