mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
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>
This commit is contained in:
parent
a71208b2a0
commit
bf89d86ba8
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue