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

Function flows_probability

plugins/askrene/child/refine.c:676–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676double flows_probability(const tal_t *ctx, struct route_query *rq,
677 struct flow ***flows)
678{
679 const tal_t *working_ctx = tal(ctx, tal_t);
680 struct reserve_hop *reservations = new_reservations(working_ctx, rq);
681 double probability = 1.0;
682
683 for (size_t i = 0; i < tal_count(*flows); i++) {
684 probability *= flow_probability((*flows)[i], rq);
685 create_flow_reservations(rq, &reservations, (*flows)[i]);
686 }
687 tal_free(working_ctx);
688 return probability;
689}
690
691const char *reduce_num_flows(const tal_t *ctx,
692 const struct route_query *rq,

Callers 1

linear_routesFunction · 0.85

Calls 4

new_reservationsFunction · 0.85
create_flow_reservationsFunction · 0.85
tal_freeFunction · 0.85
flow_probabilityFunction · 0.70

Tested by

no test coverage detected