[feature] - routing: add additional validation to MPP related send payment params #8916
Labels
beginner
Issues suitable for new developers
enhancement
Improvements to existing features / behaviour
rpc
Related to the RPC interface
validation
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_parts
max_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 = 2
max_shard_size_msat = 10_000
amt_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.
The text was updated successfully, but these errors were encountered: