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

Function gossmap_refresh

common/gossmap.c:1361–1385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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