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

Function gossmap_refresh

common/gossmap.c:947–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945}
946
947bool gossmap_refresh(struct gossmap *map, size_t *num_rejected)
948{
949 off_t len;
950
951 /* You must remove local updates before this. */
952 assert(!map->local);
953
954 /* If file has gotten larger, try rereading */
955 len = lseek(map->fd, 0, SEEK_END);
956 if (len == map->map_size)
957 return false;
958
959 if (map->mmap)
960 munmap(map->mmap, map->map_size);
961 map->map_size = len;
962 map->mmap = mmap(NULL, map->map_size, PROT_READ, MAP_SHARED, map->fd, 0);
963 if (map->mmap == MAP_FAILED)
964 map->mmap = NULL;
965 return map_catchup(map, num_rejected);
966}
967
968struct gossmap *gossmap_load(const tal_t *ctx, const char *filename,
969 size_t *num_channel_updates_rejected)

Callers 8

reopen_storeFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
get_gossmapFunction · 0.85
get_gossmapFunction · 0.85
get_gossmapFunction · 0.85
mainFunction · 0.85

Calls 1

map_catchupFunction · 0.85

Tested by 4

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