Skip to content

Commit

Permalink
channel: don't log scary disconnect message on unowned channels.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Changelog-Fixed: `lightningd`: don't log gratuitous "Peer transient failure" message on first connection after restart.
  • Loading branch information
rustyrussell committed Apr 5, 2023
1 parent 0043177 commit 64d3f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lightningd/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4379,7 +4379,6 @@ def test_peer_disconnected_reflected_in_channel_state(node_factory):
wait_for(lambda: only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['peer_connected'] is False)


@pytest.mark.xfail(strict=True)
@pytest.mark.developer("needs dev-no-reconnect")
def test_reconnect_no_additional_transient_failure(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True},
Expand Down

0 comments on commit 64d3f3b

Please sign in to comment.