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

Function visit

devtools/topology.c:100–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static void visit(const struct gossmap *map,
101 struct gossmap_node *n,
102 struct gossmap_node *exclude,
103 bool *visited)
104{
105 if (n == exclude)
106 return;
107 if (visited[gossmap_node_idx(map, n)])
108 return;
109 visited[gossmap_node_idx(map, n)] = true;
110
111 for (size_t i = 0; i < n->num_chans; i++) {
112 int dir;
113 struct gossmap_chan *c;
114 c = gossmap_nth_chan(map, n, i, &dir);
115
116 if (!channel_usable(map, c, dir, AMOUNT_MSAT(0), NULL))
117 continue;
118 visit(map, gossmap_nth_node(map, c, !dir), exclude, visited);
119 }
120}
121
122/* What nodes can n reach without going through exclude? */
123static size_t count_possible_destinations(const struct gossmap *map,

Callers 1

Calls 4

gossmap_node_idxFunction · 0.85
gossmap_nth_chanFunction · 0.85
channel_usableFunction · 0.85
gossmap_nth_nodeFunction · 0.85

Tested by

no test coverage detected