-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Is your feature request related to a problem? Please describe.
Today, for the SendPaymentV2 call we have a series of mpp parameters users can define:
max_partsmax_shard_size_msat
If users aren't careful, then it's possible that the combination of: max parts, max shard size, and the payment amount are incompatible.
Here's an example of incompatible params:
max_parts = 2max_shard_size_msat = 10_000amt_msat = 100_000
In this case, we can't satisfy the payment as with only two max parts, we can only send 20_000 msat.
Describe the solution you'd like
Add validation, reject if params don't allow the full value to be sent.
Describe alternatives you've considered
Silently modify the params to make them compatible.
Additional context
Right now incorrect values just result in a path finding loop that'll go until the timeout, as the payment flow can't actually be satisfied.