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

Function gossmap_refresh

common/gossmap.c:1366–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1364}
1365
1366bool gossmap_refresh(struct gossmap *map)
1367{
1368 off_t len;
1369 bool changed;
1370
1371 /* You must remove local modifications before this. */
1372 assert(!map->local_announces);
1373
1374 /* If file has gotten larger, remap */
1375 len = lseek(map->fd, 0, SEEK_END);
1376 if (len != map->map_size) {
1377 if (map->mmap)
1378 munmap(map->mmap, map->map_size);
1379 map->map_size = len;
1380
1381 if (map->mmap) {
1382 map->mmap = mmap(NULL, map->map_size, PROT_READ, MAP_SHARED, map->fd, 0);
1383 if (map->mmap == MAP_FAILED)
1384 map->mmap = NULL;
1385 }
1386 }
1387
1388 map_catchup(map, NULL, NULL, false, &changed);
1389 return changed;
1390}
1391
1392static void log_stderr(void *cb_arg,
1393 enum log_level level,

Callers 15

get_gossmapFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
get_raw_gossmapFunction · 0.85
do_check_gossipFunction · 0.85
get_gossmapFunction · 0.85
get_gossmapFunction · 0.85
do_getroutesFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

map_catchupFunction · 0.85

Tested by 6

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68