minor changes

This commit is contained in:
yutianwu
2018-11-30 13:01:36 +08:00
parent e255b30c63
commit 98128e72fa
3 changed files with 14 additions and 17 deletions
+6 -7
View File
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/spf13/cobra"
cfg "github.com/tendermint/tendermint/config"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/p2p"
@@ -26,17 +25,17 @@ func initFiles(cmd *cobra.Command, args []string) error {
func initFilesWithConfig(config *cfg.Config) error {
// private validator
privValkeyFile := config.PrivValidatorKeyFile()
privValKeyFile := config.PrivValidatorKeyFile()
privValStateFile := config.PrivValidatorStateFile()
var pv *privval.FilePV
if cmn.FileExists(privValkeyFile) {
pv = privval.LoadFilePV(privValkeyFile, privValStateFile)
logger.Info("Found private validator", "keyFile", privValkeyFile,
if cmn.FileExists(privValKeyFile) {
pv = privval.LoadFilePV(privValKeyFile, privValStateFile)
logger.Info("Found private validator", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
} else {
pv = privval.GenFilePV(privValkeyFile, privValStateFile)
pv = privval.GenFilePV(privValKeyFile, privValStateFile)
pv.Save()
logger.Info("Generated private validator", "keyFile", privValkeyFile,
logger.Info("Generated private validator", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
}