mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
lightningd: derive JSONRPC ids from incoming id (append /cln:<method>#NNN).
Usually the calls are spontanous, so it's just "cln:<method>#NNN", but json_invoice() calls listincoming, and json_checkmessage calls listnodes, so those become "cli:invoice-<pid>/cln:listincoming#NNN". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1142,7 +1142,8 @@ static struct command_result *plugin_rpcmethod_dispatch(struct command *cmd,
|
||||
call = tal(plugin, struct plugin_rpccall);
|
||||
call->cmd = cmd;
|
||||
|
||||
req = jsonrpc_request_start_raw(plugin, cmd->json_cmd->name, plugin->log,
|
||||
req = jsonrpc_request_start_raw(plugin, cmd->json_cmd->name, cmd->id,
|
||||
plugin->log,
|
||||
plugin_notify_cb,
|
||||
plugin_rpcmethod_cb, call);
|
||||
call->request = req;
|
||||
@@ -1729,7 +1730,8 @@ const char *plugin_send_getmanifest(struct plugin *p)
|
||||
* write-only on p->stdin */
|
||||
p->stdout_conn = io_new_conn(p, stdoutfd, plugin_stdout_conn_init, p);
|
||||
p->stdin_conn = io_new_conn(p, stdinfd, plugin_stdin_conn_init, p);
|
||||
req = jsonrpc_request_start(p, "getmanifest", p->log,
|
||||
/* FIXME: id_prefix from caller! */
|
||||
req = jsonrpc_request_start(p, "getmanifest", NULL, p->log,
|
||||
NULL, plugin_manifest_cb, p);
|
||||
json_add_bool(req->stream, "allow-deprecated-apis", deprecated_apis);
|
||||
jsonrpc_request_end(req);
|
||||
@@ -1910,7 +1912,7 @@ plugin_config(struct plugin *plugin)
|
||||
struct jsonrpc_request *req;
|
||||
|
||||
plugin_set_timeout(plugin);
|
||||
req = jsonrpc_request_start(plugin, "init", plugin->log,
|
||||
req = jsonrpc_request_start(plugin, "init", NULL, plugin->log,
|
||||
NULL, plugin_config_cb, plugin);
|
||||
plugin_populate_init_request(plugin, req);
|
||||
jsonrpc_request_end(req);
|
||||
|
||||
Reference in New Issue
Block a user