mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
plugin: Add details about which plugin caused a clash in RPC methods
This commit is contained in:
committed by
neil saitug
parent
e59940eb61
commit
0bc8a47226
@@ -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 =
|
||||||
|
find_plugin_for_command(plugin->plugins->ld, cmd->name);
|
||||||
|
return tal_fmt(
|
||||||
|
plugin,
|
||||||
"Could not register method \"%s\", a method with "
|
"Could not register method \"%s\", a method with "
|
||||||
"that name is already registered",
|
"that name is already registered by plugin %s",
|
||||||
cmd->name);
|
cmd->name, p->cmd);
|
||||||
}
|
}
|
||||||
tal_arr_expand(&plugin->methods, cmd->name);
|
tal_arr_expand(&plugin->methods, cmd->name);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user