mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
validator/accounts: don't ask for keystore path if specified (#5641)
* 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
This commit is contained in:
parent
f70635a992
commit
f19aa93de2
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user