Browse Source
plugin: Plugins need a list of methods they registered
This will be used in the next commit to dispatch calls to the correct
plugin.
Signed-off-by: Christian Decker <@cdecker>
plugin-3
Christian Decker
6 years ago
No known key found for this signature in database
GPG Key ID: 1416D83DC4F0E86D
1 changed files with
4 additions and
0 deletions
-
lightningd/plugin.c
|
|
@ -33,6 +33,8 @@ struct plugin { |
|
|
|
struct list_head plugin_opts; |
|
|
|
|
|
|
|
struct list_node list; |
|
|
|
|
|
|
|
const char **methods; |
|
|
|
}; |
|
|
|
|
|
|
|
struct plugin_request { |
|
|
@ -106,6 +108,7 @@ void plugin_register(struct plugins *plugins, const char* path TAKES) |
|
|
|
plugin_count++; |
|
|
|
p->log = new_log(p, plugins->log_book, "plugin-%zu", plugin_count); |
|
|
|
p->log = plugins->log; |
|
|
|
p->methods = tal_arr(p, const char *, 0); |
|
|
|
list_head_init(&p->plugin_opts); |
|
|
|
} |
|
|
|
|
|
|
@ -460,6 +463,7 @@ static bool plugin_rpcmethod_add(struct plugin *plugin, const char *buffer, |
|
|
|
cmd->name); |
|
|
|
return false; |
|
|
|
} |
|
|
|
*tal_arr_expand(&plugin->methods) = cmd->name; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|