lightningd: add dev option to save hooks and notifications to/from plugins.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-08-17 09:39:35 +09:30
parent 69a8ccc31c
commit 9e7be804c2
4 changed files with 82 additions and 0 deletions

View File

@@ -169,6 +169,9 @@ static void plugin_hook_callback(const char *buffer, const jsmntok_t *toks,
ph_req->hook->name, toks->end - toks->start,
buffer + toks->start);
dev_save_plugin_io_in(h->plugin->plugins, "hook_in",
ph_req->hook->name,
buffer, toks);
if (!ph_req->hook->deserialize_cb(ph_req->cb_arg,
buffer, resulttok)) {
tal_free(ph_req->cb_arg);
@@ -209,6 +212,11 @@ static void plugin_hook_call_next(struct plugin_hook_request *ph_req)
hook->serialize_payload(ph_req->cb_arg, req->stream, plugin);
jsonrpc_request_end(req);
dev_save_plugin_io_out(plugin->plugins,
"hook_out", hook->name,
req->stream);
plugin_request_send(plugin, req);
}