mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
lightningd: expose internal error information.
In #1018 we got no information, except "Internal error". At least if we tell the other side what went wrong, we're more likely to get an answer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1192f16733
commit
9842e32e06
@ -297,14 +297,15 @@ void channel_fail_permanent(struct channel *channel, const char *fmt, ...)
|
|||||||
void channel_internal_error(struct channel *channel, const char *fmt, ...)
|
void channel_internal_error(struct channel *channel, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
char *why;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
log_broken(channel->log, "Peer internal error %s: ",
|
why = tal_vfmt(channel, fmt, ap);
|
||||||
channel_state_name(channel));
|
|
||||||
logv_add(channel->log, fmt, ap);
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
channel_fail_permanent(channel, "Internal error");
|
log_broken(channel->log, "Peer internal error %s: %s",
|
||||||
|
channel_state_name(channel), why);
|
||||||
|
channel_fail_permanent(channel, "Internal error: %s", why);
|
||||||
}
|
}
|
||||||
|
|
||||||
void channel_fail_transient(struct channel *channel, const char *fmt, ...)
|
void channel_fail_transient(struct channel *channel, const char *fmt, ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user