mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
fetchinvoice: don't produce invalid JSON on sent_inv timeout.
An unrelated bug in the reverse path triggered this code, and boom. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -645,7 +645,10 @@ static void timeout_sent_inv(struct sent *sent)
|
|||||||
{
|
{
|
||||||
struct json_out *details = json_out_new(sent);
|
struct json_out *details = json_out_new(sent);
|
||||||
|
|
||||||
|
json_out_start(details, NULL, '{');
|
||||||
json_out_addstr(details, "invstring", invoice_encode(tmpctx, sent->inv));
|
json_out_addstr(details, "invstring", invoice_encode(tmpctx, sent->inv));
|
||||||
|
json_out_end(details, '}');
|
||||||
|
|
||||||
/* This will free sent! */
|
/* This will free sent! */
|
||||||
discard_result(command_done_err(sent->cmd, OFFER_TIMEOUT,
|
discard_result(command_done_err(sent->cmd, OFFER_TIMEOUT,
|
||||||
"Failed: timeout waiting for response",
|
"Failed: timeout waiting for response",
|
||||||
|
|||||||
Reference in New Issue
Block a user