aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-12-10 06:42:23 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-10 06:42:23 +0800
commit46e5583993afe7b9d0ff432f846b2a97bcb89876 (patch)
treef768a04b9d0ba71fbb0251ffff761610b3ea7eb7 /cmd/utils/flags.go
parentbf62acf0332c962916787a23c78a2513137625ea (diff)
downloaddexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar.gz
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar.bz2
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar.lz
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar.xz
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.tar.zst
dexon-46e5583993afe7b9d0ff432f846b2a97bcb89876.zip
cmd/utils, eth: init etherbase from within eth (#15528)
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index aa999eaae..30edf199c 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -746,6 +746,12 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
if err != nil || index < 0 {
return accounts.Account{}, fmt.Errorf("invalid account address or index %q", account)
}
+ log.Warn("-------------------------------------------------------------------")
+ log.Warn("Referring to accounts by order in the keystore folder is dangerous!")
+ log.Warn("This functionality is deprecated and will be removed in the future!")
+ log.Warn("Please use explicit addresses! (can search via `geth account list`)")
+ log.Warn("-------------------------------------------------------------------")
+
accs := ks.Accounts()
if len(accs) <= index {
return accounts.Account{}, fmt.Errorf("index %d higher than number of accounts %d", index, len(accs))
@@ -762,15 +768,6 @@ func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) {
Fatalf("Option %q: %v", EtherbaseFlag.Name, err)
}
cfg.Etherbase = account.Address
- return
- }
- accounts := ks.Accounts()
- if (cfg.Etherbase == common.Address{}) {
- if len(accounts) > 0 {
- cfg.Etherbase = accounts[0].Address
- } else {
- log.Warn("No etherbase set and no accounts found as default")
- }
}
}