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

Function flows_to_routes

plugins/renepay/route.c:85–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85struct route **flows_to_routes(const tal_t *ctx,
86 u64 groupid, u64 partid,
87 struct sha256 payment_hash, u32 final_cltv,
88 struct gossmap *gossmap, struct flow **flows)
89{
90 assert(gossmap);
91 assert(flows);
92 const size_t N = tal_count(flows);
93 struct route **routes = tal_arr(ctx, struct route *, N);
94 for (size_t i = 0; i < N; i++) {
95 routes[i] =
96 flow_to_route(routes, groupid, partid++,
97 payment_hash, final_cltv, gossmap, flows[i],
98 false);
99 if (!routes[i])
100 goto function_fail;
101 }
102 return routes;
103
104function_fail:
105 return tal_free(routes);
106}
107
108const char *fmt_route_path(const tal_t *ctx, const struct route *route)
109{

Callers 1

mainFunction · 0.85

Calls 2

flow_to_routeFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

mainFunction · 0.68