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

Function new_channel

common/gossmap.c:381–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381static struct gossmap_chan *new_channel(struct gossmap *map,
382 u64 cannounce_off,
383 u64 plus_scid_off,
384 u32 n1idx, u32 n2idx)
385{
386 struct gossmap_chan *chan = next_free_chan(map);
387
388 chan->cann_off = cannounce_off;
389 chan->plus_scid_off = plus_scid_off;
390 chan->cupdate_off[0] = chan->cupdate_off[1] = 0;
391 memset(chan->half, 0, sizeof(chan->half));
392 chan->half[0].nodeidx = n1idx;
393 chan->half[1].nodeidx = n2idx;
394 node_add_channel(map->node_arr + n1idx, gossmap_chan_idx(map, chan));
395 node_add_channel(map->node_arr + n2idx, gossmap_chan_idx(map, chan));
396 chanidx_htable_add(map->channels, chan2ptrint(chan));
397
398 return chan;
399}
400
401static void remove_chan_from_node(struct gossmap *map,
402 struct gossmap_node *node,

Callers 1

add_channelFunction · 0.70

Calls 4

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

Tested by

no test coverage detected