mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
lightningd: don't include empty error in onion returned on failed injectpaymentonion.
fail->msg can be NULL for local failures (the error message itself is more informative in this case). Use the generic "something went wrong" message. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ef475db478
commit
d6152fdc40
1 changed files with 11 additions and 2 deletions
|
@ -1684,8 +1684,17 @@ injectonion_fail(struct command *cmd,
|
|||
struct json_stream *js;
|
||||
|
||||
/* Turn local errors into onion reply. */
|
||||
if (!onionreply)
|
||||
onionreply = create_onionreply(tmpctx, shared_secret, fail->msg);
|
||||
if (!onionreply) {
|
||||
const u8 *err;
|
||||
|
||||
/* Local error with no context, use default error */
|
||||
if (fail->msg)
|
||||
err = fail->msg;
|
||||
else
|
||||
err = towire_temporary_channel_failure(tmpctx, NULL);
|
||||
|
||||
onionreply = create_onionreply(tmpctx, shared_secret, err);
|
||||
}
|
||||
|
||||
js = json_stream_fail(cmd, PAY_INJECTPAYMENTONION_FAILED, errmsg);
|
||||
/* We wrap the onion reply, as it expects. */
|
||||
|
|
Loading…
Add table
Reference in a new issue