From 342716af48aa0ea99ed2001d547c94986f8afffb Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Mon, 26 Apr 2021 20:33:30 +0200 Subject: [PATCH] Fixed the --recover flag not working properly inside the init command (#9201) Co-authored-by: Alessio Treglia (cherry picked from commit fdbc32e50c93689ec7352c11edb6d93f33d47a6c) --- x/genutil/client/cli/init.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 074bb7da4e74..f5fda79c69f0 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -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") }