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

Function new_channel

common/gossmap.c:378–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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