From 8f8942cda98acb43678c0af4d0381505c9b28d11 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Wed, 13 Nov 2024 20:16:12 +0100 Subject: [PATCH 1/2] routerrpc: fix sendpayment_v2 negative fee limit --- lnrpc/marshall_utils.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lnrpc/marshall_utils.go b/lnrpc/marshall_utils.go index 0dcbe46fa..230fea35b 100644 --- a/lnrpc/marshall_utils.go +++ b/lnrpc/marshall_utils.go @@ -23,6 +23,9 @@ var ( ErrSatMsatMutualExclusive = errors.New( "sat and msat arguments are mutually exclusive", ) + + // ErrNegativeAmt is returned when a negative amount is specified. + ErrNegativeAmt = errors.New("amount cannot be negative") ) // CalculateFeeLimit returns the fee limit in millisatoshis. If a percentage @@ -56,6 +59,10 @@ func UnmarshallAmt(amtSat, amtMsat int64) (lnwire.MilliSatoshi, error) { return 0, ErrSatMsatMutualExclusive } + if amtSat < 0 || amtMsat < 0 { + return 0, ErrNegativeAmt + } + if amtSat != 0 { return lnwire.NewMSatFromSatoshis(btcutil.Amount(amtSat)), nil } From de451d72c720bde81689f996b9a9286ce6562267 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Thu, 14 Nov 2024 11:39:48 +0100 Subject: [PATCH 2/2] docs: update release notes --- docs/release-notes/release-notes-0.19.0.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/release-notes-0.19.0.md b/docs/release-notes/release-notes-0.19.0.md index 04092157c..c3048c78c 100644 --- a/docs/release-notes/release-notes-0.19.0.md +++ b/docs/release-notes/release-notes-0.19.0.md @@ -28,10 +28,14 @@ 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 + would not signal an error when trying to bump a non-anchor channel but instead report a successful cpfp registration although no fee bumping is possible for non-anchor channels anyways. +* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/9269) where a + negative fee limit for `SendPaymentV2` would lead to omitting the fee limit + check. + * [Use the required route blinding feature-bit](https://github.com/lightningnetwork/lnd/pull/9143) for invoices containing blinded paths. @@ -196,6 +200,7 @@ The underlying functionality between those two options remain the same. * CharlieZKSmith * Elle Mouton * George Tsagkarelis +* hieblmi * Oliver Gugger * Pins * Viktor Tigerström