mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
Min. Cost Flow does not take into account fees when computing a flow with liquidity constraints. This is a work-around solution that reduces the amount on every route to respect the liquidity bound. The deficity in the delivered amount is solved by running MCF once again. Changes: 1. the function `flow_complete` allocates amounts to send over the set of routes computed by the MCF algorithm, but it does not allocate more than liquidity bound of the route. For this reason `minflow` returns a set of routes that satisfy the liquidity bounds but it is not guaranteed that the total payment reaches the destination therefore there could a deficit in the delivery: `deficit = amount_to_deliver - delivering`. 2. in the function `add_payflows` after `minflow` returns a set of routes we call `flows_fit_amount` that tries to a allocate the `deficit` in the routes that the MCF have computed. 3. if the resulting flows pass all payment constraints then we update `amount_to_deliver = amount_to_deliver - delivering`, and the loop repeats as long as `amount_to_deliver` is not zero. In other words, the excess amount, beyond the liquidity bound, in the routes is removed and then we try to allocate it into known routes, otherwise we do a whole MCF again just for the remaining amount. Fixes issue #6599 |
||
---|---|---|
.. | ||
bkpr | ||
clnrest | ||
examples | ||
grpc-plugin | ||
renepay | ||
spender | ||
src | ||
test | ||
.gitignore | ||
autoclean.c | ||
bcli.c | ||
Cargo.toml | ||
chanbackup.c | ||
commando.c | ||
fetchinvoice.c | ||
funder.c | ||
funder_policy.c | ||
funder_policy.h | ||
keysend.c | ||
libplugin-pay.c | ||
libplugin-pay.h | ||
libplugin.c | ||
libplugin.h | ||
Makefile | ||
offers.c | ||
offers.h | ||
offers_inv_hook.c | ||
offers_inv_hook.h | ||
offers_invreq_hook.c | ||
offers_invreq_hook.h | ||
offers_offer.c | ||
offers_offer.h | ||
pay.c | ||
README.md | ||
sql.c | ||
topology.c | ||
txprepare.c |
Plugin Directory
Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).