Assign the delivered amount to the flow if it fits the path maximum capacity. */
| 416 | /* Assign the delivered amount to the flow if it fits |
| 417 | the path maximum capacity. */ |
| 418 | bool 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 | * |
nothing calls this directly
no test coverage detected