[router] Avoid re-selecting the same path over and over again
authorMatt Corallo <git@bluematt.me>
Sat, 27 Mar 2021 02:31:57 +0000 (22:31 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 7 Apr 2021 01:41:45 +0000 (21:41 -0400)
commit16a6e9c5c8f694750e87c3f4ea0acb6d74ca8b44
tree4e60eaac638aa1ef536ccb1a414dd0cfb66ac5a9
parent93311b3684c2ad90e80f888641c775b16c0c25a3
[router] Avoid re-selecting the same path over and over again

If we walk the network graph and find a route that meets are
payment amount and has a liquidiy limit far in excess of our
payment amount, we may select the same path several times in the
main path-gathering loop.

Instead, if the path we selected was not limited by the available
liquidity, we set the middle hop in the path's liquidity available
to zero, disabling that channel in future path finding steps.
lightning/src/routing/router.rs