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

Function add_chan

gossipd/routing.c:154–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154static void add_chan(struct node *node, struct chan *chan)
155{
156 if (!node_uses_chan_map(node)) {
157 for (size_t i = 0; i < NUM_IMMEDIATE_CHANS; i++) {
158 if (node->chans.arr[i] == NULL) {
159 node->chans.arr[i] = chan;
160 return;
161 }
162 }
163 convert_node_to_chan_map(node);
164 }
165
166 chan_map_add(&node->chans.map, chan);
167}
168
169static struct chan *next_chan_arr(const struct node *node,
170 struct chan_map_iter *i)

Callers 1

new_chanFunction · 0.85

Calls 2

node_uses_chan_mapFunction · 0.85
convert_node_to_chan_mapFunction · 0.85

Tested by

no test coverage detected