Skip to content

Commit

Permalink
validator/accounts: don't ask for keystore path if specified (#5641)
Browse files Browse the repository at this point in the history
* validator/accounts: don't ask for keystore path of specified
* Merge branch 'master' into master
* Merge branch 'master' into master
* validator/accounts restore new validator account creation
* Merge branch 'master' into master
  • Loading branch information
q9f authored Apr 27, 2020
1 parent f70635a commit f19aa93
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions validator/accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,17 @@ func CreateValidatorAccount(path string, passphrase string) (string, string, err

if path == "" {
path = DefaultValidatorDir()
log.Infof("Please specify a keystore path to save your private keys (default: %q):", path)
reader := bufio.NewReader(os.Stdin)
text, err := reader.ReadString('\n')
if err != nil {
log.Fatal(err)
return path, passphrase, err
}
if text = strings.Replace(text, "\n", "", -1); text != "" {
path = text
}
}
log.Infof("Keystore path to save your private keys (default: %q):", path)
reader := bufio.NewReader(os.Stdin)
text, err := reader.ReadString('\n')
if err != nil {
log.Fatal(err)
return path, passphrase, err
}
if text = strings.Replace(text, "\n", "", -1); text != "" {
path = text
}

if err := NewValidatorAccount(path, passphrase); err != nil {
return "", "", errors.Wrapf(err, "could not initialize validator account")
}
Expand Down

0 comments on commit f19aa93

Please sign in to comment.