diff --git a/CHANGELOG.md b/CHANGELOG.md index c382f5a90..27e59a2ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ changes. ### Fixed +- Plugin: `pay` no longer crashes on timeout. + ### Security ## [0.7.1] - 2019-06-29: "The Unfailing Twitter Consensus Algorithm" diff --git a/plugins/pay.c b/plugins/pay.c index 2e094b1f0..3b3bcf50d 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -232,11 +232,13 @@ static struct command_result *waitsendpay_expired(struct command *cmd, json_out_start(data, NULL, '{'); json_out_start(data, "attempts", '['); for (size_t i = 0; i < tal_count(pc->ps->attempts); i++) { + json_out_start(data, NULL, '{'); if (pc->ps->attempts[i].route) json_out_add_raw(data, "route", pc->ps->attempts[i].route); json_out_add_splice(data, "failure", pc->ps->attempts[i].failure); + json_out_end(data, '}'); } json_out_end(data, ']'); json_out_end(data, '}');