Merge pull request #8822 from michael1011/fix-config-error-handling

cfg: fail startup on flags.Error parsing error
This commit is contained in:
Olaoluwa Osuntokun 2024-06-18 17:51:24 -07:00 committed by GitHub
commit c0f7c2849d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -38,6 +38,7 @@ import (
"github.com/lightningnetwork/lnd/lnrpc/peersrpc" "github.com/lightningnetwork/lnd/lnrpc/peersrpc"
"github.com/lightningnetwork/lnd/lnrpc/routerrpc" "github.com/lightningnetwork/lnd/lnrpc/routerrpc"
"github.com/lightningnetwork/lnd/lnrpc/signrpc" "github.com/lightningnetwork/lnd/lnrpc/signrpc"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing" "github.com/lightningnetwork/lnd/routing"
@ -771,7 +772,9 @@ func LoadConfig(interceptor signal.Interceptor) (*Config, error) {
// If it's a parsing related error, then we'll return // If it's a parsing related error, then we'll return
// immediately, otherwise we can proceed as possibly the config // immediately, otherwise we can proceed as possibly the config
// file doesn't exist which is OK. // file doesn't exist which is OK.
if _, ok := err.(*flags.IniError); ok { if lnutils.ErrorAs[*flags.IniError](err) ||
lnutils.ErrorAs[*flags.Error](err) {
return nil, err return nil, err
} }

View File

@ -22,10 +22,13 @@
* `closedchannels` now [successfully reports](https://github.com/lightningnetwork/lnd/pull/8800) * `closedchannels` now [successfully reports](https://github.com/lightningnetwork/lnd/pull/8800)
settled balances even if the delivery address is set to an address that settled balances even if the delivery address is set to an address that
LND does not control. LND does not control.
* [SendPaymentV2](https://github.com/lightningnetwork/lnd/pull/8734) now cancels * [SendPaymentV2](https://github.com/lightningnetwork/lnd/pull/8734) now cancels
the background payment loop if the user cancels the stream context. the background payment loop if the user cancels the stream context.
* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/8822) that caused
LND to read the config only partially and continued with the startup.
# New Features # New Features
## Functional Enhancements ## Functional Enhancements
## RPC Additions ## RPC Additions