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

Function visit

devtools/clean_topo.c:5–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <devtools/clean_topo.h>
4
5static void visit(struct gossmap *map,
6 struct gossmap_node *n,
7 bool *visited)
8{
9 visited[gossmap_node_idx(map, n)] = true;
10
11 for (size_t i = 0; i < n->num_chans; i++) {
12 int dir;
13 struct gossmap_chan *c = gossmap_nth_chan(map, n, i, &dir);
14 struct gossmap_node *peer;
15
16 peer = gossmap_nth_node(map, c, !dir);
17 if (!visited[gossmap_node_idx(map, peer)])
18 visit(map, peer, visited);
19 }
20}
21
22void clean_topo(struct gossmap *map, bool remove_singles)
23{

Callers 1

clean_topoFunction · 0.70

Calls 3

gossmap_node_idxFunction · 0.85
gossmap_nth_chanFunction · 0.85
gossmap_nth_nodeFunction · 0.85

Tested by

no test coverage detected