[router] Do not fail if we are exactly (or 3x) limited by a maximum
authorMatt Corallo <git@bluematt.me>
Sat, 27 Mar 2021 02:51:41 +0000 (22:51 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 7 Apr 2021 01:41:45 +0000 (21:41 -0400)
commit5c38e09b2616ee78ccaa257dc4502f2f373c4a9e
tree0e7bff2b5626f36065cabc07e686b81ed6150268
parent512642c32d33ada109d5a2c87d5cd0579c2cb91f
[router] Do not fail if we are exactly (or 3x) limited by a maximum

The new MPP routing algorithm attempts to build paths with a higher
value than our payment to find paths which may allow us to pay a
fee to meet an htlc_minimum limit. This is great if we're
min-bounded, however it results in us rejecting paths where we are
bounded by a maximum near the end of the path, with fees, and then
bounded by a minimum earlier in the path. Further, it means we will
not find the cheapest path where paths have a lower relative fee
but a higher absolute fee.

Instead, we calculate routes using the actual amount we wish to
send. To maintain the previous behavior of searching for cheaper
paths where we can "pay the difference" to meet an htlc_minimum, we
detect if we were minimum-bounded during graph walking and, if we
are, we walk the graph again with a higher value.
lightning/src/routing/router.rs