mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 16:14:26 +01:00
plugin: Introduce plugin type to allow singleton and chaining
The newly introduced type is used to determine what the call semantics of the
hook are. We have `single` corresponding to the old behavior, as well as
`chain` which allows multiple plugins to register for the hook, and they are
then called sequentially (if all plugins return `{"result": "continue"}`) or
exit the chain if the hook event was handled.
This commit is contained in:
committed by
Rusty Russell
parent
30580731a6
commit
9a2a09efd6
@@ -753,7 +753,8 @@ rpc_command_hook_callback(struct rpc_command_hook_payload *p,
|
||||
"Bad response to 'rpc_command' hook."));
|
||||
}
|
||||
|
||||
REGISTER_PLUGIN_HOOK(rpc_command, rpc_command_hook_callback,
|
||||
REGISTER_PLUGIN_HOOK(rpc_command, PLUGIN_HOOK_SINGLE,
|
||||
rpc_command_hook_callback,
|
||||
struct rpc_command_hook_payload *,
|
||||
rpc_command_hook_serialize,
|
||||
struct rpc_command_hook_payload *);
|
||||
|
||||
Reference in New Issue
Block a user