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

Function new_channel

common/gossmap.c:345–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static struct gossmap_chan *new_channel(struct gossmap *map,
346 u32 cannounce_off,
347 u32 plus_scid_off,
348 bool private,
349 u32 n1idx, u32 n2idx)
350{
351 struct gossmap_chan *chan = next_free_chan(map);
352
353 chan->cann_off = cannounce_off;
354 chan->private = private;
355 chan->plus_scid_off = plus_scid_off;
356 chan->cupdate_off[0] = chan->cupdate_off[1] = 0;
357 memset(chan->half, 0, sizeof(chan->half));
358 chan->half[0].nodeidx = n1idx;
359 chan->half[1].nodeidx = n2idx;
360 node_add_channel(map->node_arr + n1idx, gossmap_chan_idx(map, chan));
361 node_add_channel(map->node_arr + n2idx, gossmap_chan_idx(map, chan));
362 chanidx_htable_add(&map->channels, chan2ptrint(chan));
363
364 return chan;
365}
366
367static void remove_chan_from_node(struct gossmap *map,
368 struct gossmap_node *node,

Callers 3

add_channelFunction · 0.70
wallet_stmt2channelFunction · 0.50

Calls 4

next_free_chanFunction · 0.85
node_add_channelFunction · 0.85
gossmap_chan_idxFunction · 0.85
chan2ptrintFunction · 0.85

Tested by 1