channel: don't log scary disconnect message on unowned channels.

We always call channel_fail_transient() on all channels when a peer
connects, to clean up any previous connections.  However, when
we startup, this channel doesn't have an owner yet, resulting in
a fairly weird INFO level message.

Reported-by: Michael Schmook @mschmook
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: `lightningd`: don't log gratuitous "Peer transient failure" message on first connection after restart.
This commit is contained in:
Rusty Russell
2023-04-03 14:19:05 +09:30
parent 00431779a6
commit 64d3f3be26
2 changed files with 4 additions and 1 deletions

View File

@@ -963,6 +963,10 @@ void channel_set_billboard(struct channel *channel, bool perm, const char *str)
static void channel_err(struct channel *channel, const char *why)
{
/* Nothing to do if channel isn't actually owned! */
if (!channel->owner)
return;
log_info(channel->log, "Peer transient failure in %s: %s",
channel_state_name(channel), why);