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
…#9201)

Co-authored-by: Alessio Treglia <[email protected]>
(cherry picked from commit fdbc32e)
  • Loading branch information
RiccardoM authored and mergify-bot committed Aug 4, 2021
1 parent 7f41de9 commit 342716a
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 342716a

Please sign in to comment.