config: add sanity check to prevent non-negative worker counts

This commit is contained in:
Conner Fromknecht
2019-03-13 20:32:52 -07:00
parent 76116f0d1a
commit d81ce61033
3 changed files with 129 additions and 0 deletions

View File

@@ -990,6 +990,12 @@ func loadConfig() (*config, error) {
"minbackoff")
}
// Assert that all worker pools will have a positive number of
// workers, otherwise the pools will rendered useless.
if err := cfg.Workers.Validate(); err != nil {
return nil, err
}
// Finally, ensure that the user's color is correctly formatted,
// otherwise the server will not be able to start after the unlocking
// the wallet.