lightningd: drive all reconnections out of disconnections.

The only places which should call try_reconnect now are the "connect"
command, and the disconnect path when it decides there's still an
active channel.

This introduces one subtlety: if we disconnect when there's no active
channel, but then the subd makes one, we have to catch that case!

This temporarily reverts "slow" reconnections to fast ones: see next
patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-18 21:42:28 +09:30
committed by neil saitug
parent a3c4908f4a
commit 02e169fd27
12 changed files with 98 additions and 64 deletions

View File

@@ -68,14 +68,14 @@ void channel_fail_permanent(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED,
...)
{ fprintf(stderr, "channel_fail_permanent called!\n"); abort(); }
/* Generated stub for channel_fail_reconnect */
void channel_fail_reconnect(struct channel *channel UNNEEDED,
/* Generated stub for channel_fail_transient */
void channel_fail_transient(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED, ...)
{ fprintf(stderr, "channel_fail_reconnect called!\n"); abort(); }
/* Generated stub for channel_fail_reconnect_later */
void channel_fail_reconnect_later(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED,...)
{ fprintf(stderr, "channel_fail_reconnect_later called!\n"); abort(); }
{ fprintf(stderr, "channel_fail_transient called!\n"); abort(); }
/* Generated stub for channel_fail_transient_delayreconnect */
void channel_fail_transient_delayreconnect(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED,...)
{ fprintf(stderr, "channel_fail_transient_delayreconnect called!\n"); abort(); }
/* Generated stub for channel_has_htlc_in */
struct htlc_in *channel_has_htlc_in(struct channel *channel UNNEEDED)
{ fprintf(stderr, "channel_has_htlc_in called!\n"); abort(); }