lightningd: don't restart subds unnecessarily on reconnect.

During tests we can see that the subdaemon can be restarted unnecessarily if we're slow enough; we don't need to do so if it's still running.

Reported-by: Matt Morehouse <mattmorehouse@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-08-21 10:18:48 +09:30
parent dec8ad3b8d
commit af39424491
1 changed files with 2 additions and 1 deletions

View File

@ -1276,7 +1276,8 @@ static void peer_connected_hook_final(struct peer_connected_hook_payload *payloa
/* connect appropriate subds for all (active) channels! */
list_for_each(&peer->channels, channel, list) {
if (channel_active(channel)) {
/* FIXME: It can race by opening a channel before this! */
if (channel_active(channel) && !channel->owner) {
log_debug(channel->log, "Peer has reconnected, state %s: connecting subd",
channel_state_name(channel));