mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-10 07:18:45 +02:00
Merge pull request #9269 from hieblmi/sendpayment-fix-negative-feelimit
routerrpc: fix sendpayment_v2 negative fee limit
This commit is contained in:
@@ -28,10 +28,14 @@
|
|||||||
does not contain a payment address.
|
does not contain a payment address.
|
||||||
|
|
||||||
* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/9033) where we
|
* [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
|
instead report a successful cpfp registration although no fee bumping is
|
||||||
possible for non-anchor channels anyways.
|
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
|
* [Use the required route blinding
|
||||||
feature-bit](https://github.com/lightningnetwork/lnd/pull/9143) for invoices
|
feature-bit](https://github.com/lightningnetwork/lnd/pull/9143) for invoices
|
||||||
containing blinded paths.
|
containing blinded paths.
|
||||||
@@ -196,6 +200,7 @@ The underlying functionality between those two options remain the same.
|
|||||||
* CharlieZKSmith
|
* CharlieZKSmith
|
||||||
* Elle Mouton
|
* Elle Mouton
|
||||||
* George Tsagkarelis
|
* George Tsagkarelis
|
||||||
|
* hieblmi
|
||||||
* Oliver Gugger
|
* Oliver Gugger
|
||||||
* Pins
|
* Pins
|
||||||
* Viktor Tigerström
|
* Viktor Tigerström
|
||||||
|
@@ -23,6 +23,9 @@ var (
|
|||||||
ErrSatMsatMutualExclusive = errors.New(
|
ErrSatMsatMutualExclusive = errors.New(
|
||||||
"sat and msat arguments are mutually exclusive",
|
"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
|
// 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
|
return 0, ErrSatMsatMutualExclusive
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if amtSat < 0 || amtMsat < 0 {
|
||||||
|
return 0, ErrNegativeAmt
|
||||||
|
}
|
||||||
|
|
||||||
if amtSat != 0 {
|
if amtSat != 0 {
|
||||||
return lnwire.NewMSatFromSatoshis(btcutil.Amount(amtSat)), nil
|
return lnwire.NewMSatFromSatoshis(btcutil.Amount(amtSat)), nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user