Skip to content

Commit

Permalink
Fixed the --recover flag not working properly inside the init command (
Browse files Browse the repository at this point in the history
…cosmos#9201)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
  • Loading branch information
RiccardoM and Alessio Treglia authored Apr 26, 2021
1 parent 49bf077 commit fdbc32e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/genutil/client/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command {
recover, _ := cmd.Flags().GetBool(FlagRecover)
if recover {
inBuf := bufio.NewReader(cmd.InOrStdin())
mnemonic, err := input.GetString("Enter your bip39 mnemonic", inBuf)
value, err := input.GetString("Enter your bip39 mnemonic", inBuf)
if err != nil {
return err
}

mnemonic = value
if !bip39.IsMnemonicValid(mnemonic) {
return errors.New("invalid mnemonic")
}
Expand Down

0 comments on commit fdbc32e

Please sign in to comment.