mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
b0054aad46
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 |
||
---|---|---|
.. | ||
data | ||
fuzz | ||
plugins | ||
vectors | ||
benchmark.py | ||
conftest.py | ||
db.py | ||
fixtures.py | ||
rkls_github_canned_server.py | ||
test_bookkeeper.py | ||
test_cln_rs.py | ||
test_clnrest.py | ||
test_closing.py | ||
test_connection.py | ||
test_db.py | ||
test_gossip.py | ||
test_invoices.py | ||
test_misc.py | ||
test_mkfunding.py | ||
test_onion.py | ||
test_opening.py | ||
test_pay.py | ||
test_plugin.py | ||
test_reckless.py | ||
test_renepay.py | ||
test_runes.py | ||
test_splicing_disconnect.py | ||
test_splicing_insane.py | ||
test_splicing.py | ||
test_wallet.py | ||
utils.py | ||
valgrind-suppressions.txt |