From d032a23647d24c25e4378d18e0ab054aa581b092 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 14 Aug 2023 15:15:10 +0930 Subject: [PATCH] plugins/renepay: don't require raw_message in error reply. It's not there if it's a local error: ``` { "code": 202, "message": "Parsing '{message:%,data:{erring_index:%,failcode:%,raw_message:': object does not have member raw_message" } ``` Reported-by: https://github.com/daywalker90 Fixes: #6553 Signed-off-by: Rusty Russell --- plugins/renepay/pay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/renepay/pay.c b/plugins/renepay/pay.c index aae578aa6..bfbaf38fc 100644 --- a/plugins/renepay/pay.c +++ b/plugins/renepay/pay.c @@ -1285,11 +1285,12 @@ static struct pf_result *sendpay_failure(struct pay_flow *pf, } /* Extract remaining fields for feedback */ + raw = NULL; err = json_scan(tmpctx, buf, sub, "{message:%" ",data:{erring_index:%" ",failcode:%" - ",raw_message:%}}", + ",raw_message?:%}}", JSON_SCAN_TAL(tmpctx, json_strdup, &msg), JSON_SCAN(json_to_u32, &erridx), JSON_SCAN(json_to_u32, &onionerr),