cmd/utils: restore starting geth without any accounts and etherbase

Also remove some duplication around address/index parsing.
This commit is contained in:
Felix Lange
2015-12-01 11:20:49 +01:00
parent f4a6470a7b
commit d648e96b3d
2 changed files with 18 additions and 21 deletions

View File

@ -464,9 +464,12 @@ func execScripts(ctx *cli.Context) {
node.Stop()
}
// tries unlocking the specified account a few times.
func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i int, passwords []string) (common.Address, string) {
// Try to unlock the specified account a few times
account := utils.MakeAddress(accman, address)
account, err := utils.MakeAddress(accman, address)
if err != nil {
utils.Fatalf("Unlock error: %v", err)
}
for trials := 0; trials < 3; trials++ {
prompt := fmt.Sprintf("Unlocking account %s | Attempt %d/%d", address, trials+1, 3)