rgb-cln/plugins/renepay/test
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
..
Makefile renepay: remove custom debug, in favor of normal operations. 2023-09-25 13:59:13 +09:30
run-arc.c error handling in mcf.c 2024-01-22 15:10:08 +10:30
run-dijkstra.c plugins/renepay/dijkstra: improve API to remove global. 2023-07-31 12:58:56 +09:30
run-mcf-diamond.c error handling in mcf.c 2024-01-22 15:10:08 +10:30
run-mcf.c error handling in mcf.c 2024-01-22 15:10:08 +10:30
run-payflow_map.c renepay: put the entire hash in the key struct. 2023-08-12 09:41:24 +09:30
run-testflow.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30