Skip to content

Commit 1be4d42

Browse files
rustyrussellcdecker
authored andcommitted
fetchinvoice: don't abort() if we try to fetch an invoice from ourselves.
blindedpath.c does: ``` size_t num = tal_count(route); if (!num) abort(); ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent d953c68 commit 1be4d42

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/fetchinvoice.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,11 @@ static struct command_result *send_message(struct command *cmd,
602602
}
603603
}
604604

605+
/* FIXME: Maybe we should allow this? */
606+
if (tal_bytelen(backwards) == 0)
607+
return command_fail(cmd, PAY_ROUTE_NOT_FOUND,
608+
"Refusing to talk to ourselves");
609+
605610
/* Ok, now make reply for onion_message */
606611
path = make_blindedpath(tmpctx, backwards, &blinding,
607612
&sent->reply_blinding);

0 commit comments

Comments
 (0)