| 308 | } |
| 309 | |
| 310 | static 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 | |
| 326 | struct plugin *plugin_register(struct plugins *plugins, const char* path TAKES, |
| 327 | struct plugin_command *start_cmd, bool important, |
no test coverage detected