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

Function remove_chan_from_node

common/gossmap.c:367–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367static void remove_chan_from_node(struct gossmap *map,
368 struct gossmap_node *node,
369 u32 chanidx)
370{
371 size_t i;
372
373 if (node->num_chans == 1) {
374 remove_node(map, node);
375 return;
376 }
377 for (i = 0; node->chan_idxs[i] != chanidx; i++)
378 assert(i < node->num_chans);
379
380 memmove(node->chan_idxs + i,
381 node->chan_idxs + i + 1,
382 sizeof(node->chan_idxs[0]) * (node->num_chans - i - 1));
383 node->num_chans--;
384}
385
386void gossmap_remove_chan(struct gossmap *map, struct gossmap_chan *chan)
387{

Callers 1

gossmap_remove_chanFunction · 0.70

Calls 1

remove_nodeFunction · 0.85

Tested by

no test coverage detected