| 98 | } |
| 99 | |
| 100 | static 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? */ |
| 123 | static size_t count_possible_destinations(const struct gossmap *map, |
no test coverage detected