lightningd: only use non-numeric JSON ids if plugin says we can.

We also remember whether the id is a string or not, for replacement in
JSON passthrough.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-11-21 12:18:32 +10:30
committed by Christian Decker
parent 24651f57ad
commit d5ce5cbab3
9 changed files with 84 additions and 47 deletions

View File

@@ -235,6 +235,7 @@ static void plugin_hook_call_next(struct plugin_hook_request *ph_req)
log_debug(ph_req->ld->log, "Calling %s hook of plugin %s",
ph_req->hook->name, ph_req->plugin->shortname);
req = jsonrpc_request_start(NULL, hook->name, ph_req->cmd_id,
ph_req->plugin->non_numeric_ids,
plugin_get_log(ph_req->plugin),
NULL,
plugin_hook_callback, ph_req);
@@ -380,7 +381,9 @@ void plugin_hook_db_sync(struct db *db)
/* FIXME: id_prefix from caller? */
/* FIXME: do IO logging for this! */
req = jsonrpc_request_start(NULL, hook->name, NULL, NULL, NULL,
req = jsonrpc_request_start(NULL, hook->name, NULL,
dwh_req->plugin->non_numeric_ids,
NULL, NULL,
db_hook_response,
dwh_req);