Skip to content

Commit

Permalink
lightningd: log if builtin plugin fails to start
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Lagrang3 committed Aug 27, 2024
1 parent 48fa438 commit 1401275
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2536,14 +2536,19 @@ void plugins_set_builtin_plugins_dir(struct plugins *plugins,
const char *dir)
{
/*~ Load the builtin plugins as important. */
for (size_t i = 0; list_of_builtin_plugins[i]; ++i)
plugin_register(plugins,
take(path_join(NULL, dir,
list_of_builtin_plugins[i])),
NULL,
/* important = */
!streq(list_of_builtin_plugins[i], "cln-renepay"),
NULL, NULL);
for (size_t i = 0; list_of_builtin_plugins[i]; ++i) {
struct plugin *p = plugin_register(
plugins,
take(path_join(NULL, dir, list_of_builtin_plugins[i])),
NULL,
/* important = */
!streq(list_of_builtin_plugins[i], "cln-renepay"), 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)
Expand Down

0 comments on commit 1401275

Please sign in to comment.