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

This commit is contained in:
Conner Fromknecht committed 2019-03-13 20:32:52 -07:00
1 parent 76116f0d1a
commit d81ce61033
3 files changed
+129

No files matched your search

+6
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.