Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow nodes to overshoot the MPP
total_msat
when paying (#1031)
When a node retires a failed path as part of a larger MPP payment, the node may wish to use a path which is constrained by an `htlc_minimum_msat` value. In this case, the node is forced to overpay, likely overshooting the `total_msat` it set in the earlier onions for the same MPP payment. There are two possible solutions to this - either allow the `total_msat` value to change in later HTLCs or allow the node to (slightly) overshoot the `total_msat` value. Allowing `total_msat` to change across HTLCs is nontrivial to implement - HTLCs may arrive out-of-order, causing the receiving node to have to track all seen `total_msat` values and accept a set of HTLCs which meet any of the seen `total_msat` values. Instead, this commit changes the MPP logic to simply allow a sender to overshoot the stated `total_msat`. Sadly the backwards-compatibility story for this is not great. There doesn't seem to be a good way to resolve this issue in a backwards-compatible way. Instead we just bite the bullet and make the incompatible change, hoping the overshooting is rare enough that it's not a major issue.
- Loading branch information