renepay: don't crash if we get failure from sendpay.

This happened while I was hacking (it shouldn't normally!): cmd here is NULL.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-08-29 13:51:33 +09:30
parent b88583e346
commit 14e28a51ce

View File

@ -295,11 +295,11 @@ static struct command_result *flow_sendpay_failed(struct command *cmd,
"{code:%,message:%}",
JSON_SCAN(json_to_jsonrpc_errcode, &errcode),
JSON_SCAN_TAL(tmpctx, json_strdup, &msg))) {
plugin_err(cmd->plugin, "Bad fail from sendpay: %.*s",
plugin_err(pay_plugin->plugin, "Bad fail from sendpay: %.*s",
json_tok_full_len(err), json_tok_full(buf, err));
}
if (errcode != PAY_TRY_OTHER_ROUTE)
plugin_err(cmd->plugin, "Strange error from sendpay: %.*s",
plugin_err(pay_plugin->plugin, "Strange error from sendpay: %.*s",
json_tok_full_len(err), json_tok_full(buf, err));
/* There is no new knowledge from this kind of failure.