Skip to content

Commit c0f7c28

Browse files
authored
Merge pull request #8822 from michael1011/fix-config-error-handling
cfg: fail startup on flags.Error parsing error
2 parents e6f7a2d + 01f5af0 commit c0f7c28

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"github.com/lightningnetwork/lnd/lnrpc/peersrpc"
3939
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
4040
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
41+
"github.com/lightningnetwork/lnd/lnutils"
4142
"github.com/lightningnetwork/lnd/lnwallet"
4243
"github.com/lightningnetwork/lnd/lnwire"
4344
"github.com/lightningnetwork/lnd/routing"
@@ -771,7 +772,9 @@ func LoadConfig(interceptor signal.Interceptor) (*Config, error) {
771772
// If it's a parsing related error, then we'll return
772773
// immediately, otherwise we can proceed as possibly the config
773774
// file doesn't exist which is OK.
774-
if _, ok := err.(*flags.IniError); ok {
775+
if lnutils.ErrorAs[*flags.IniError](err) ||
776+
lnutils.ErrorAs[*flags.Error](err) {
777+
775778
return nil, err
776779
}
777780

docs/release-notes/release-notes-0.18.1.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
* `closedchannels` now [successfully reports](https://github.com/lightningnetwork/lnd/pull/8800)
2323
settled balances even if the delivery address is set to an address that
2424
LND does not control.
25-
25+
2626
* [SendPaymentV2](https://github.com/lightningnetwork/lnd/pull/8734) now cancels
2727
the background payment loop if the user cancels the stream context.
2828

29+
* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/8822) that caused
30+
LND to read the config only partially and continued with the startup.
31+
2932
# New Features
3033
## Functional Enhancements
3134
## RPC Additions

0 commit comments

Comments
 (0)