lightningd: add support for filters on "rpc_command" hook.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: the `rpc_command` hook can now specify a "filter" on what commands it is interested in.
This commit is contained in:
Rusty Russell
2025-11-20 12:07:13 +10:30
parent d76a9050ad
commit d9d82ac5bd
2 changed files with 9 additions and 7 deletions

View File

@@ -506,7 +506,8 @@ The `htlc_accepted` hook is a chained hook, i.e., multiple plugins can register
### `rpc_command`
The `rpc_command` hook allows a plugin to take over any RPC command. It sends the received JSON-RPC request (for any method!) to the registered plugin,
The `rpc_command` hook allows a plugin to take over any RPC command. It sends the received JSON-RPC request to the registered plugin. You can optionally specify a "filters" array, containing the command names you want to intercept: without this, all commands will be sent to this hook.
```json
{