mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
lightningd: tell connectd to disconnect even if it's connecting now.
We were seeing hangs in disconnect in tests/test_connection.py::test_feerate_stress, and looking at the logs it's because we're not actually telling connectd to disconnect. These days, we have a connect counter, so connectd knows to ignore it if we simply haven't read the message about it already disconnecting. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2318,11 +2318,9 @@ static struct command_result *json_disconnect(struct command *cmd,
|
||||
channel_state_name(channel));
|
||||
}
|
||||
|
||||
/* If it's not already disconnecting, tell connectd to disconnect */
|
||||
if (peer->connected == PEER_CONNECTED)
|
||||
subd_send_msg(peer->ld->connectd,
|
||||
take(towire_connectd_discard_peer(NULL, &peer->id,
|
||||
peer->connectd_counter)));
|
||||
subd_send_msg(peer->ld->connectd,
|
||||
take(towire_connectd_discard_peer(NULL, &peer->id,
|
||||
peer->connectd_counter)));
|
||||
|
||||
/* Connectd tells us when it's finally disconnected */
|
||||
dc = tal(cmd, struct disconnect_command);
|
||||
|
||||
Reference in New Issue
Block a user