mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Fix Accounts Creation Error (#6748)
* add check * Merge refs/heads/master into fixAccountsError * Merge refs/heads/master into fixAccountsError
This commit is contained in:
parent
7861005990
commit
8a69d34b96
@ -20,6 +20,21 @@ var log = logrus.WithField("prefix", "accounts-v2")
|
||||
// a wallet from the user's specified path.
|
||||
func CreateAccount(cliCtx *cli.Context) error {
|
||||
ctx := context.Background()
|
||||
walletDir, err := inputDirectory(cliCtx, walletDirPromptText, flags.WalletDirFlag)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "Could not retrieve input directory")
|
||||
}
|
||||
ok, err := hasDir(walletDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Create a new wallet if no directory exists.
|
||||
if !ok {
|
||||
err = CreateWallet(cliCtx)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "Could not create wallet")
|
||||
}
|
||||
}
|
||||
wallet, err := OpenWallet(cliCtx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not open wallet")
|
||||
|
@ -117,7 +117,6 @@ func inputPassword(cliCtx *cli.Context, promptText string, confirmPassword passw
|
||||
}
|
||||
return strings.TrimRight(enteredPassword, "\r\n"), nil
|
||||
}
|
||||
|
||||
var hasValidPassword bool
|
||||
var walletPassword string
|
||||
var err error
|
||||
@ -132,7 +131,6 @@ func inputPassword(cliCtx *cli.Context, promptText string, confirmPassword passw
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not read account password: %v", formatPromptError(err))
|
||||
}
|
||||
|
||||
if confirmPassword == confirmPass {
|
||||
prompt = promptui.Prompt{
|
||||
Label: confirmPasswordPromptText,
|
||||
|
Loading…
Reference in New Issue
Block a user