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

Function del_front_log

lightningd/log.c:249–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 node_id_map);
248
249static void del_front_log(struct log_book *log)
250{
251 struct log_hdr hdr;
252 void *buf1, *buf2;
253 size_t buf1len, buf2len;
254
255 ringbuf_span(log, log->ringbuf_start, sizeof(hdr),
256 &buf1, &buf1len, &buf2, &buf2len);
257 copy_from(&hdr, sizeof(hdr), buf1, buf1len, buf2, buf2len);
258 assert(ringbuf_used(log) >= sizeof(hdr) + hdr.msglen + hdr.iolen);
259 log->ringbuf_start += sizeof(hdr) + hdr.msglen + hdr.iolen;
260
261 if (hdr.nc && --hdr.nc->count == 0)
262 tal_free(hdr.nc);
263 log_prefix_drop(hdr.prefix);
264}
265
266/* We truncate genuinely giant messages */
267static char *cap_header(const tal_t *ctx, struct log_hdr *hdr, const char *msg)

Callers 2

add_entryFunction · 0.85
destroy_log_bookFunction · 0.85

Calls 5

ringbuf_spanFunction · 0.85
copy_fromFunction · 0.85
ringbuf_usedFunction · 0.85
tal_freeFunction · 0.85
log_prefix_dropFunction · 0.85

Tested by

no test coverage detected