mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
config: validate node color after reading config
This commit is contained in:
12
config.go
12
config.go
@@ -934,8 +934,8 @@ func loadConfig() (*config, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, ensure that we are only listening on localhost if Tor
|
||||
// inbound support is enabled.
|
||||
// Ensure that we are only listening on localhost if Tor inbound support
|
||||
// is enabled.
|
||||
if cfg.Tor.V2 || cfg.Tor.V3 {
|
||||
for _, addr := range cfg.Listeners {
|
||||
if lncfg.IsLoopback(addr.String()) {
|
||||
@@ -948,6 +948,14 @@ func loadConfig() (*config, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, ensure that the user's color is correctly formatted,
|
||||
// otherwise the server will not be able to start after the unlocking
|
||||
// the wallet.
|
||||
_, err = parseHexColor(cfg.Color)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to parse node color: %v", err)
|
||||
}
|
||||
|
||||
// Warn about missing config file only after all other configuration is
|
||||
// done. This prevents the warning on help messages and invalid
|
||||
// options. Note this should go directly before the return.
|
||||
|
Reference in New Issue
Block a user