-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove excessive wrapping in the rpc_command
hook call
#3560
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -611,8 +611,22 @@ struct rpc_command_hook_payload { | |
static void rpc_command_hook_serialize(struct rpc_command_hook_payload *p, | ||
struct json_stream *s) | ||
{ | ||
const jsmntok_t *tok; | ||
size_t i; | ||
char *key; | ||
json_object_start(s, "rpc_command"); | ||
json_add_tok(s, "rpc_command", p->request, p->buffer); | ||
|
||
#ifdef COMPAT_V081 | ||
if (deprecated_apis) | ||
json_add_tok(s, "rpc_command", p->request, p->buffer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh i came across this yesterday. can you remove the outer object and instead do this line? it should achieve the same result without needing to iterate through the object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to do that, however if I use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack. i understand what this outputs now. thanks. |
||
#endif | ||
|
||
json_for_each_obj(i, tok, p->request) { | ||
key = tal_strndup(NULL, p->buffer + tok->start, | ||
tok->end - tok->start); | ||
json_add_tok(s, key, tok + 1, p->buffer); | ||
tal_free(key); | ||
} | ||
json_object_end(s); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this commit needs a Changelog-Deprecated line ?