Skip to content

Commit d15f5a9

Browse files
committed
lightningd: don't even transiently try to connect to private nodes if --dev-no-reconnect-private.
Christian reported that this flag doesn't work on restart. Indeed, it made us attempt *transient* rather than *persistent* connections, but we still told connectd to connect. Signed-off-by: Rusty Russell <[email protected]> Changelog-Fixed: connectd: `dev-no-reconnect-private` is respected on restart.
1 parent a4e64fa commit d15f5a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lightningd/peer_control.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,11 @@ static void setup_peer(struct peer *peer)
25512551
break;
25522552
}
25532553

2554+
/* Don't reconnect for private channels if --dev-no-reconnect-private */
2555+
if (!channel->peer->ld->reconnect_private
2556+
&& !(channel->channel_flags & CHANNEL_FLAGS_ANNOUNCE_CHANNEL))
2557+
continue;
2558+
25542559
if (channel_state_wants_peercomms(channel->state))
25552560
connect = true;
25562561
if (channel_important_filter(channel, NULL))

tests/test_connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4756,7 +4756,6 @@ def test_onionmessage_forward_fail(node_factory, bitcoind):
47564756
l2.daemon.is_in_log('plugin-onionmessage_forward_fail_notification.py: Received onionmessage_forward_fail')
47574757

47584758

4759-
@pytest.mark.xfail(strict=True)
47604759
def test_private_channel_no_reconnect(node_factory):
47614760
l1, l2 = node_factory.line_graph(2,
47624761
announce_channels=False,

0 commit comments

Comments
 (0)