plugin: Add details about which plugin caused a clash in RPC methods

This commit is contained in:
Christian Decker
2021-03-09 11:01:43 +01:00
committed by neil saitug
parent e59940eb61
commit 0bc8a47226

View File

@@ -1073,10 +1073,13 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
cmd->dispatch = plugin_rpcmethod_dispatch; cmd->dispatch = plugin_rpcmethod_dispatch;
if (!jsonrpc_command_add(plugin->plugins->ld->jsonrpc, cmd, usage)) { if (!jsonrpc_command_add(plugin->plugins->ld->jsonrpc, cmd, usage)) {
return tal_fmt(plugin, struct plugin *p =
"Could not register method \"%s\", a method with " find_plugin_for_command(plugin->plugins->ld, cmd->name);
"that name is already registered", return tal_fmt(
cmd->name); plugin,
"Could not register method \"%s\", a method with "
"that name is already registered by plugin %s",
cmd->name, p->cmd);
} }
tal_arr_expand(&plugin->methods, cmd->name); tal_arr_expand(&plugin->methods, cmd->name);
return NULL; return NULL;