Relax the channel saturation limit if we can't find enough paths
authorMatt Corallo <git@bluematt.me>
Fri, 8 Jul 2022 19:48:00 +0000 (19:48 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 13 Jul 2022 18:36:50 +0000 (18:36 +0000)
commita02982fbba53d2b630cc024d1fed6ed37ed0b4e0
tree2e39b0c0a62e843c70c39709cabd037f68c748b6
parentbd6b710328ec6d116d43162ac6922e5b007e3e3c
Relax the channel saturation limit if we can't find enough paths

In order to avoid failing to find paths due to the new channel
saturation limit, if we fail to find enough paths, we simply
disable the saturation limit for further path finding iterations.

Because we can now increase the maximum sent over a given channel
during routefinding, we may now generate redundant paths for the
same payment. Because this is wasteful in the network, we add an
additional pass during routefinding to merge redundant paths.

Note that two tests which previously attempted to send exactly the
available liquidity over a channel which charged an absolute fee
need updating - in those cases the router will first collect a path
that is saturation-limited, then attempt to collect a second path
without a saturation limit while stil honoring the existing
utilized capacity on the channel, causing failure as the absolute
fee must be included.
lightning/src/ln/functional_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/routing/router.rs