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

Function gossmap_remove_localmods

common/gossmap.c:1331–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1329}
1330
1331void gossmap_remove_localmods(struct gossmap *map,
1332 const struct gossmap_localmods *localmods)
1333{
1334 size_t n = tal_count(localmods->mods);
1335
1336 assert(map->local_announces == localmods->local_announces);
1337
1338 for (size_t i = 0; i < n; i++) {
1339 const struct localmod *mod = &localmods->mods[i];
1340 struct gossmap_chan *chan = gossmap_find_chan(map, &mod->scid);
1341
1342 /* If there was no channel, ignore */
1343 if (!chan)
1344 continue;
1345
1346 /* If that's a local channel, remove it now. */
1347 if (chan->cann_off >= map->map_size) {
1348 gossmap_remove_chan(map, chan);
1349 } else {
1350 /* Restore. */
1351 for (size_t h = 0; h < 2; h++) {
1352 chan->half[h] = mod->orig[h];
1353 chan->cupdate_off[h] = mod->orig_cupdate_off[h];
1354 }
1355 }
1356 }
1357 map->local_announces = NULL;
1358 map->local_updates = tal_free(map->local_updates);
1359}
1360
1361bool gossmap_refresh(struct gossmap *map)
1362{

Callers 12

mainFunction · 0.85
path_to_nodeFunction · 0.85
put_gossmapFunction · 0.85
source_free_layerFunction · 0.85
do_getroutesFunction · 0.85
refreshgossmap_cbFunction · 0.85
routehints_doneFunction · 0.85
compute_routes_cbFunction · 0.85
channelfilter_cbFunction · 0.85

Calls 3

gossmap_find_chanFunction · 0.85
gossmap_remove_chanFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

mainFunction · 0.68