From 01f5af0a28b84cd3653a1e9645d6db7e6e5f1712 Mon Sep 17 00:00:00 2001 From: michael1011 Date: Mon, 10 Jun 2024 15:07:14 +0200 Subject: [PATCH] cfg: fail startup on flags.Error parsing error --- config.go | 5 ++++- docs/release-notes/release-notes-0.18.1.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 13fd2c832..8953b6d4b 100644 --- a/config.go +++ b/config.go @@ -38,6 +38,7 @@ import ( "github.com/lightningnetwork/lnd/lnrpc/peersrpc" "github.com/lightningnetwork/lnd/lnrpc/routerrpc" "github.com/lightningnetwork/lnd/lnrpc/signrpc" + "github.com/lightningnetwork/lnd/lnutils" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" "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 // immediately, otherwise we can proceed as possibly the config // 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 } diff --git a/docs/release-notes/release-notes-0.18.1.md b/docs/release-notes/release-notes-0.18.1.md index e58d65d36..92ce40a67 100644 --- a/docs/release-notes/release-notes-0.18.1.md +++ b/docs/release-notes/release-notes-0.18.1.md @@ -22,10 +22,13 @@ * `closedchannels` now [successfully reports](https://github.com/lightningnetwork/lnd/pull/8800) settled balances even if the delivery address is set to an address that LND does not control. - + * [SendPaymentV2](https://github.com/lightningnetwork/lnd/pull/8734) now cancels 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 ## Functional Enhancements ## RPC Additions