From 1fbe56da0ca4d1c7634300b5c8709e77dda45195 Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Tue, 8 Feb 2022 01:05:31 +0700 Subject: [PATCH] Fix issue 7782 (#7783) Co-authored-by: Simon Kirillov Co-authored-by: Sam Kleinman --- cmd/tendermint/commands/init.go | 9 ++++----- cmd/tendermint/commands/testnet.go | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/tendermint/commands/init.go b/cmd/tendermint/commands/init.go index 33d511097..d5f8b338b 100644 --- a/cmd/tendermint/commands/init.go +++ b/cmd/tendermint/commands/init.go @@ -30,7 +30,7 @@ func MakeInitFilesCommand(conf *config.Config, logger log.Logger) *cobra.Command return errors.New("must specify a node type: tendermint init [validator|full|seed]") } conf.Mode = args[0] - return initFilesWithConfig(cmd.Context(), conf, logger) + return initFilesWithConfig(cmd.Context(), conf, logger, keyType) }, } @@ -40,11 +40,10 @@ func MakeInitFilesCommand(conf *config.Config, logger log.Logger) *cobra.Command return cmd } -func initFilesWithConfig(ctx context.Context, conf *config.Config, logger log.Logger) error { +func initFilesWithConfig(ctx context.Context, conf *config.Config, logger log.Logger, keyType string) error { var ( - pv *privval.FilePV - err error - keyType string + pv *privval.FilePV + err error ) if conf.Mode == config.ModeValidator { diff --git a/cmd/tendermint/commands/testnet.go b/cmd/tendermint/commands/testnet.go index 82954e41b..82c8cc6f9 100644 --- a/cmd/tendermint/commands/testnet.go +++ b/cmd/tendermint/commands/testnet.go @@ -138,7 +138,7 @@ Example: return err } - if err := initFilesWithConfig(ctx, config, logger); err != nil { + if err := initFilesWithConfig(ctx, config, logger, keyType); err != nil { return err } @@ -180,7 +180,7 @@ Example: return err } - if err := initFilesWithConfig(ctx, conf, logger); err != nil { + if err := initFilesWithConfig(ctx, conf, logger, keyType); err != nil { return err } }