From dc2f9a9088fa9dbebf0c12fad78849fceb90fc5c Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 5 Feb 2020 13:30:07 +0100 Subject: [PATCH] plugin: Internalize plugin_hook call payload in the request struct We are about to call multiple plugins, and we'll have to pass the payload into each call. Sadly the serialized stream gets consumed during the call, so keep the unserialized payload around. --- lightningd/plugin_hook.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index 8498b1f67..9419d6ef5 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -13,6 +13,7 @@ struct plugin_hook_request { int current_plugin; const struct plugin_hook *hook; void *cb_arg; + void *payload; struct db *db; }; @@ -129,6 +130,7 @@ void plugin_hook_call_(struct lightningd *ld, const struct plugin_hook *hook, ph_req->hook = hook; ph_req->cb_arg = cb_arg; ph_req->db = ld->wallet->db; + ph_req->payload = payload; ph_req->current_plugin = 0; ph_req->plugin = hook->plugins[ph_req->current_plugin];