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

Function file_checksum

lightningd/plugin.c:310–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310static u32 file_checksum(struct lightningd *ld, const char *path)
311{
312 char *content;
313 u32 crc;
314
315 if (ld->dev_no_plugin_checksum)
316 return 0;
317
318 content = grab_file_raw(tmpctx, path);
319 crc = crc32c(0, content, tal_count(content));
320 /* We could leave this around, but we checksum many files in a loop,
321 * causing 450MB of allocations at startup! */
322 tal_free(content);
323 return crc;
324}
325
326struct plugin *plugin_register(struct plugins *plugins, const char* path TAKES,
327 struct plugin_command *start_cmd, bool important,

Callers 1

plugin_registerFunction · 0.85

Calls 3

grab_file_rawFunction · 0.85
crc32cFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected