mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
jsonrpc: use tal destructor to remove json commands when required.
This fixes a bug with a plugin duplicating an existing name where we'd crash, too. This doesn't work for builtins, which aren't tal objects, so create a separate path for them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -168,17 +168,11 @@ void jsonrpc_listen(struct jsonrpc *rpc, struct lightningd *ld);
|
||||
*
|
||||
* Returns true if the command was added correctly, false if adding
|
||||
* this would clobber a command name.
|
||||
*
|
||||
* Free @command to remove it.
|
||||
*/
|
||||
bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command);
|
||||
|
||||
/**
|
||||
* Remove a command/method from the JSON-RPC.
|
||||
*
|
||||
* Used to dynamically remove a `struct json_command` from the
|
||||
* JSON-RPC dispatch table by its name.
|
||||
*/
|
||||
void jsonrpc_command_remove(struct jsonrpc *rpc, const char *method);
|
||||
|
||||
/**
|
||||
* Begin a JSON-RPC notification with the specified topic.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user