Skip to content

Commit 2bd9c22

Browse files
Lagrang3ShahanaFarooqui
authored andcommitted
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 <[email protected]>
1 parent 78b9ccf commit 2bd9c22

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

lightningd/plugin.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,14 +2536,19 @@ void plugins_set_builtin_plugins_dir(struct plugins *plugins,
25362536
const char *dir)
25372537
{
25382538
/*~ Load the builtin plugins as important. */
2539-
for (size_t i = 0; list_of_builtin_plugins[i]; ++i)
2540-
plugin_register(plugins,
2541-
take(path_join(NULL, dir,
2542-
list_of_builtin_plugins[i])),
2543-
NULL,
2544-
/* important = */
2545-
!streq(list_of_builtin_plugins[i], "cln-renepay"),
2546-
NULL, NULL);
2539+
for (size_t i = 0; list_of_builtin_plugins[i]; ++i) {
2540+
struct plugin *p = plugin_register(
2541+
plugins,
2542+
take(path_join(NULL, dir, list_of_builtin_plugins[i])),
2543+
NULL,
2544+
/* important = */
2545+
!streq(list_of_builtin_plugins[i], "cln-renepay"), NULL,
2546+
NULL);
2547+
if (!p)
2548+
log_unusual(
2549+
plugins->log, "failed to register plugin %s",
2550+
path_join(tmpctx, dir, list_of_builtin_plugins[i]));
2551+
}
25472552
}
25482553

25492554
void shutdown_plugins(struct lightningd *ld)

0 commit comments

Comments
 (0)