| 1102 | } |
| 1103 | |
| 1104 | struct plugin *find_plugin_for_command(struct lightningd *ld, |
| 1105 | const char *cmd_name) |
| 1106 | { |
| 1107 | struct plugins *plugins = ld->plugins; |
| 1108 | struct plugin *plugin; |
| 1109 | |
| 1110 | /* Find the plugin that registered this RPC call */ |
| 1111 | list_for_each(&plugins->plugins, plugin, list) { |
| 1112 | for (size_t i=0; i<tal_count(plugin->methods); i++) { |
| 1113 | if (streq(cmd_name, plugin->methods[i])) |
| 1114 | return plugin; |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | return NULL; |
| 1119 | } |
| 1120 | |
| 1121 | static struct command_result *plugin_rpcmethod_dispatch(struct command *cmd, |
| 1122 | const char *buffer, |
no outgoing calls
no test coverage detected