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

Function remove_chan_from_node

common/gossmap.c:401–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

gossmap_remove_chanFunction · 0.85

Calls 1

remove_nodeFunction · 0.85

Tested by

no test coverage detected