config: set default mailbox address

Make the LNC authenticator use the default mailbox address whenever the
config does not specify a custom one.
This commit is contained in:
positiveblue
2023-07-05 09:18:04 -07:00
parent 87bb996a40
commit cd7ee83b57

View File

@@ -82,6 +82,10 @@ const (
// invoiceMacaroonName is the name of the invoice macaroon belonging
// to the target lnd node.
invoiceMacaroonName = "invoice.macaroon"
// defaultMailboxAddress is the default address of the mailbox server
// that will be used if none is specified.
defaultMailboxAddress = "mailbox.terminal.lightning.today:443"
)
var (
@@ -591,6 +595,11 @@ func getConfig() (*Config, error) {
cfg.Authenticator.MacDir,
)
// Set default mailbox address if none is set.
if cfg.Authenticator.MailboxAddress == "" {
cfg.Authenticator.MailboxAddress = defaultMailboxAddress
}
// Then check the configuration that we got from the config file, all
// required values need to be set at this point.
if err := cfg.validate(); err != nil {