lightningd: log if builtin plugin fails to start

Lightningd should log if a builtin plugin fails to start instead of
silently skip over it.

Changelog-Add: log message if builtin plugin fails to start.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
This commit is contained in:
Lagrang3 2024-08-27 21:58:41 +01:00 committed by ShahanaFarooqui
parent 78b9ccf432
commit 2bd9c2285a

View file

@ -2536,14 +2536,19 @@ void plugins_set_builtin_plugins_dir(struct plugins *plugins,
const char *dir) const char *dir)
{ {
/*~ Load the builtin plugins as important. */ /*~ Load the builtin plugins as important. */
for (size_t i = 0; list_of_builtin_plugins[i]; ++i) for (size_t i = 0; list_of_builtin_plugins[i]; ++i) {
plugin_register(plugins, struct plugin *p = plugin_register(
take(path_join(NULL, dir, plugins,
list_of_builtin_plugins[i])), take(path_join(NULL, dir, list_of_builtin_plugins[i])),
NULL, NULL,
/* important = */ /* important = */
!streq(list_of_builtin_plugins[i], "cln-renepay"), !streq(list_of_builtin_plugins[i], "cln-renepay"), NULL,
NULL, NULL); NULL);
if (!p)
log_unusual(
plugins->log, "failed to register plugin %s",
path_join(tmpctx, dir, list_of_builtin_plugins[i]));
}
} }
void shutdown_plugins(struct lightningd *ld) void shutdown_plugins(struct lightningd *ld)