MCPcopy Create free account
hub / github.com/ElementsProject/lightning / flow_assign_delivery

Function flow_assign_delivery

plugins/renepay/flow.c:418–429  ·  view source on GitHub ↗

Assign the delivered amount to the flow if it fits the path maximum capacity. */

Source from the content-addressed store, hash-verified

416/* Assign the delivered amount to the flow if it fits
417 the path maximum capacity. */
418bool flow_assign_delivery(struct flow *flow, const struct gossmap *gossmap,
419 struct chan_extra_map *chan_extra_map,
420 struct amount_msat requested_amount)
421{
422 struct amount_msat max_deliverable = AMOUNT_MSAT(0);
423 if (flow_maximum_deliverable(&max_deliverable, flow, gossmap,
424 chan_extra_map, NULL))
425 return false;
426 assert(!amount_msat_is_zero(max_deliverable));
427 flow->amount = amount_msat_min(requested_amount, max_deliverable);
428 return true;
429}
430
431/* Helper function to find the success_prob for a single flow
432 *

Callers

nothing calls this directly

Calls 3

flow_maximum_deliverableFunction · 0.85
amount_msat_is_zeroFunction · 0.85
amount_msat_minFunction · 0.85

Tested by

no test coverage detected