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

Function add_entry

lightningd/log.c:354–367  ·  view source on GitHub ↗

This may move entry! */

Source from the content-addressed store, hash-verified

352
353/* This may move entry! */
354static void add_entry(struct log *log, struct log_entry **l)
355{
356 log->lr->mem_used += mem_used(*l);
357 log->lr->num_entries++;
358
359 if (log->lr->mem_used > log->lr->max_mem) {
360 size_t old_mem = log->lr->mem_used, deleted;
361 deleted = prune_log(log->lr);
362 /* Will have moved, but will be last entry. */
363 *l = &log->lr->log[log->lr->num_entries-1];
364 log_debug(log, "Log pruned %zu entries (mem %zu -> %zu)",
365 deleted, old_mem, log->lr->mem_used);
366 }
367}
368
369static void destroy_node_id_cache(struct node_id_cache *nc, struct log_book *lr)
370{

Callers 2

logvFunction · 0.85
log_ioFunction · 0.85

Calls 2

mem_usedFunction · 0.85
prune_logFunction · 0.85

Tested by

no test coverage detected