plugins: update for new deprecation API where all fields are nicely wrapped.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-07-07 11:42:26 +09:30
parent 4e5e38f4b0
commit 99b885c84c
2 changed files with 6 additions and 2 deletions

View File

@@ -1055,7 +1055,7 @@ static struct command_result *json_disconnect(struct command *cmd,
const char *err; const char *err;
err = json_scan(tmpctx, buf, params, err = json_scan(tmpctx, buf, params,
"{id:%}", "{disconnect:{id:%}}",
JSON_SCAN(json_to_node_id, &id)); JSON_SCAN(json_to_node_id, &id));
if (err) if (err)
plugin_err(cmd->plugin, plugin_err(cmd->plugin,

View File

@@ -78,7 +78,11 @@ static struct command_result *json_connected(struct command *cmd,
const char *buf, const char *buf,
const jsmntok_t *params) const jsmntok_t *params)
{ {
const jsmntok_t *idtok = json_get_member(buf, params, "id"); const jsmntok_t *connecttok, *idtok;
connecttok = json_get_member(buf, params, "connect");
assert(connecttok);
idtok = json_get_member(buf, connecttok, "id");
assert(idtok); assert(idtok);
plugin_log(cmd->plugin, LOG_INFORM, "%s connected", plugin_log(cmd->plugin, LOG_INFORM, "%s connected",
json_strdup(tmpctx, buf, idtok)); json_strdup(tmpctx, buf, idtok));