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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-01-14 14:40:55 +10:30 committed by Christian Decker
parent d953c68d58
commit 1be4d42ca3

View file

@ -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);