Merge PR #2284: Prevent create_empty_blocks=false

This commit is contained in:
Dev Ojha
2018-09-11 17:15:38 +08:00
committed by Christopher Goes
parent 2e0fc15dd4
commit 2a49406e9b
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -51,6 +51,10 @@ func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
if err != nil {
return err
}
err = validateConfig(config)
if err != nil {
return err
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel())
if err != nil {
@@ -96,6 +100,14 @@ func interceptLoadConfig() (conf *cfg.Config, err error) {
return
}
// validate the config with the sdk's requirements.
func validateConfig(conf *cfg.Config) error {
if conf.Consensus.CreateEmptyBlocks == false {
return errors.New("config option CreateEmptyBlocks = false is currently unsupported")
}
return nil
}
// add server commands
func AddCommands(
ctx *Context, cdc *wire.Codec,