Skip to content
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

Fixup pay crashes #3630

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static struct command_result *waitsendpay_expired(struct command *cmd,
for (size_t i = 0; i < tal_count(pc->ps->attempts); i++) {
json_object_start(data, NULL);
if (pc->ps->attempts[i].route)
json_add_member(data, "route", false, "%s",
json_add_member(data, "route", true, "%s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this looks like json_add_string() would be better? add_member is pretty low-level...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, but fixed in #3632

pc->ps->attempts[i].route);
json_out_add_splice(data->jout, "failure",
pc->ps->attempts[i].failure);
Expand Down Expand Up @@ -698,6 +698,9 @@ static bool maybe_exclude(struct pay_command *pc,
{
const jsmntok_t *scid, *dir;

if (!route)
return false;

scid = json_get_member(buf, route, "channel");

if (node_or_channel_in_routehint(pc->plugin,
Expand Down