Skip to content

Commit

Permalink
nits - plugin_rpcmethod_add
Browse files Browse the repository at this point in the history
  • Loading branch information
gudnuf committed Aug 5, 2024
1 parent 9cde4fc commit 4517fbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
const jsmntok_t *nametok, *usagetok, *deprtok;
struct json_command *cmd;
const char *usage, *err;
char *collision_name;

nametok = json_get_member(buffer, meth, "name");
usagetok = json_get_member(buffer, meth, "usage");
Expand Down Expand Up @@ -1488,11 +1489,11 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
cmd->dev_only = false;
cmd->dispatch = plugin_rpcmethod_dispatch;
cmd->check = plugin_rpcmethod_check;
char *collision_name;
if (!jsonrpc_command_add(plugin->plugins->ld->jsonrpc, cmd, usage,
&collision_name)) {
struct plugin *p = find_plugin_for_command(plugin->plugins->ld,
collision_name);
/** p will be NULL if collision occurs within this plugin */
if (!p) {
p = plugin;
}
Expand Down

0 comments on commit 4517fbe

Please sign in to comment.