node: ConfigFromViper

This commit is contained in:
Ethan Buchman
2017-05-04 22:43:55 -04:00
parent 57151d6043
commit 7db7bbe464
4 changed files with 19 additions and 18 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ var replayCmd = &cobra.Command{
Short: "Replay messages from WAL",
Run: func(cmd *cobra.Command, args []string) {
config := getConfig()
consensus.RunReplayFile(config.Config, config.Consensus, false)
consensus.RunReplayFile(&config.Config, config.Consensus, false)
},
}
@@ -20,7 +20,7 @@ var replayConsoleCmd = &cobra.Command{
Short: "Replay messages from WAL in a console",
Run: func(cmd *cobra.Command, args []string) {
config := getConfig()
consensus.RunReplayFile(config.Config, config.Consensus, true)
consensus.RunReplayFile(&config.Config, config.Consensus, true)
},
}
+1 -5
View File
@@ -23,11 +23,7 @@ func init() {
// unmarshal viper into the Tendermint config
func getConfig() *node.Config {
config := new(node.Config)
if err := viperConfig.Unmarshal(config); err != nil {
panic(err)
}
return config
return node.ConfigFromViper(viperConfig)
}
//global flag