From 1be4d42ca3e1442c2b6dcb774e38ab61739b5a16 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 14 Jan 2021 14:40:55 +1030 Subject: [PATCH] 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 --- plugins/fetchinvoice.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index a2a2928f2..311ba99b0 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -602,6 +602,11 @@ static struct command_result *send_message(struct command *cmd, } } + /* FIXME: Maybe we should allow this? */ + if (tal_bytelen(backwards) == 0) + return command_fail(cmd, PAY_ROUTE_NOT_FOUND, + "Refusing to talk to ourselves"); + /* Ok, now make reply for onion_message */ path = make_blindedpath(tmpctx, backwards, &blinding, &sent->reply_blinding);