rgb-cln/plugins/renepay
Lagrang3 b0054aad46 renepay: accomodate fees in the payment flow
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
2024-01-29 10:48:24 +10:30
..
test renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
Makefile plugins/renepay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30
dijkstra.c plugins/renepay/dijkstra: improve API to remove global. 2023-07-31 12:58:56 +09:30
dijkstra.h plugins/renepay/dijkstra: improve API to remove global. 2023-07-31 12:58:56 +09:30
flow.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
flow.h renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
mcf.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
mcf.h error handling in mcf.c 2024-01-22 15:10:08 +10:30
pay.c renepay: add self-pay feature 2024-01-24 14:42:45 +10:30
pay.h remove amount_accumulate and amount_reduce 2024-01-22 15:10:08 +10:30
pay_flow.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
pay_flow.h renepay: remove custom debug, in favor of normal operations. 2023-09-25 13:59:13 +09:30
payment.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
payment.h renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
uncertainty_network.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
uncertainty_network.h plugins/renepay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30