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

Function remove_chan_from_node

common/gossmap.c:398–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static void remove_chan_from_node(struct gossmap *map,
399 struct gossmap_node *node,
400 u32 chanidx)
401{
402 size_t i;
403
404 if (node->num_chans == 1) {
405 remove_node(map, node);
406 return;
407 }
408 for (i = 0; node->chan_idxs[i] != chanidx; i++)
409 assert(i < node->num_chans);
410
411 memmove(node->chan_idxs + i,
412 node->chan_idxs + i + 1,
413 sizeof(node->chan_idxs[0]) * (node->num_chans - i - 1));
414 node->num_chans--;
415}
416
417void gossmap_remove_chan(struct gossmap *map, struct gossmap_chan *chan)
418{

Callers 1

gossmap_remove_chanFunction · 0.85

Calls 1

remove_nodeFunction · 0.85

Tested by

no test coverage detected