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

Function graph_push_outbound_arc

plugins/askrene/child/graph.c:5–20  ·  view source on GitHub ↗

in the background add the actual arc or dual arc */

Source from the content-addressed store, hash-verified

3
4/* in the background add the actual arc or dual arc */
5static void graph_push_outbound_arc(struct graph *graph, const struct arc arc,
6 const struct node node)
7{
8 assert(arc.idx < graph_max_num_arcs(graph));
9 assert(node.idx < graph_max_num_nodes(graph));
10
11 /* arc is already added, skip */
12 if (graph->arc_tail[arc.idx].idx != INVALID_INDEX)
13 return;
14
15 graph->arc_tail[arc.idx] = node;
16
17 const struct arc first_arc = graph->node_adjacency_first[node.idx];
18 graph->node_adjacency_next[arc.idx] = first_arc;
19 graph->node_adjacency_first[node.idx] = arc;
20}
21
22bool graph_add_arc(struct graph *graph, const struct arc arc,
23 const struct node from, const struct node to)

Callers 1

graph_add_arcFunction · 0.85

Calls 2

graph_max_num_arcsFunction · 0.85
graph_max_num_nodesFunction · 0.85

Tested by

no test coverage detected