From 0bc8a47226d50265da5bdaf8db53e63a9d6b7d38 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 9 Mar 2021 11:01:43 +0100 Subject: [PATCH] plugin: Add details about which plugin caused a clash in RPC methods --- lightningd/plugin.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index c00e8865b..ddc67fcb4 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1073,10 +1073,13 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin, cmd->dispatch = plugin_rpcmethod_dispatch; if (!jsonrpc_command_add(plugin->plugins->ld->jsonrpc, cmd, usage)) { - return tal_fmt(plugin, - "Could not register method \"%s\", a method with " - "that name is already registered", - cmd->name); + struct plugin *p = + find_plugin_for_command(plugin->plugins->ld, cmd->name); + return tal_fmt( + 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); return NULL;