From 6387c0ab501679108004a17da5929b778b912efe Mon Sep 17 00:00:00 2001 From: ziggie Date: Sun, 25 Aug 2024 09:48:01 +0200 Subject: [PATCH 1/2] walletrpc: error out for non-anchor chans. Return an error if a non-anchor channel is tried to be fee-bumped. --- lnrpc/walletrpc/walletkit_server.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lnrpc/walletrpc/walletkit_server.go b/lnrpc/walletrpc/walletkit_server.go index 5ed33cdc8..f955168f4 100644 --- a/lnrpc/walletrpc/walletkit_server.go +++ b/lnrpc/walletrpc/walletkit_server.go @@ -1179,6 +1179,11 @@ func (w *WalletKit) BumpForceCloseFee(_ context.Context, return nil, err } + if !channel.ChanType.HasAnchors() { + return nil, fmt.Errorf("not able to bump the fee of a " + + "non-anchor channel") + } + // Match pending sweeps with commitments of the channel for which a bump // is requested. Depending on the commitment state when force closing // the channel we might have up to 3 commitments to consider when @@ -1237,6 +1242,10 @@ func (w *WalletKit) BumpForceCloseFee(_ context.Context, return commitSet.Contains(sweep.OutPoint.Hash) }, pendingSweeps) + if len(anchors) == 0 { + return nil, fmt.Errorf("unable to find pending anchor outputs") + } + // Filter all relevant anchor sweeps and update the sweep request. for _, anchor := range anchors { // Anchor cpfp bump request are predictable because they are From 2915936a39709c3dd6449e6ced82570bcdad7d10 Mon Sep 17 00:00:00 2001 From: ziggie Date: Sun, 25 Aug 2024 09:57:56 +0200 Subject: [PATCH 2/2] docs: add release-notes. --- docs/release-notes/release-notes-0.19.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/release-notes/release-notes-0.19.0.md b/docs/release-notes/release-notes-0.19.0.md index 8ab6eb9c5..ee63ca58f 100644 --- a/docs/release-notes/release-notes-0.19.0.md +++ b/docs/release-notes/release-notes-0.19.0.md @@ -26,6 +26,11 @@ * [Fix a bug](https://github.com/lightningnetwork/lnd/pull/9134) that would cause a nil pointer dereference during the probing of a payment request that does not contain a payment address. + +* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/9033) where we + would not signal an error when trying to bump an non-anchor channel but + instead report a successful cpfp registration although no fee bumping is + possible for non-anchor channels anyways. # New Features ## Functional Enhancements