From 8f0796a3e0d04bbee793d4268500f510d56e9f16 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 19 Oct 2023 16:06:55 +1030 Subject: [PATCH] channeld: don't hang up immediately after sending bad reestablish warning. This gives the peer a chance to send an error, which will make us drop to chain. Signed-off-by: Rusty Russell Fixes: #5818 --- channeld/channeld.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 3efdd4e27f3d..cc3701eb7c95 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -4841,13 +4841,17 @@ static void peer_reconnect(struct peer *peer, retransmit_revoke_and_ack = true; } else if (next_revocation_number < peer->next_index[LOCAL] - 1) { /* Send a warning here! Because this is what it looks like if peer is - * in the past, and they might still recover. */ - peer_failed_warn(peer->pps, - &peer->channel_id, - "bad reestablish revocation_number: %"PRIu64 - " vs %"PRIu64, - next_revocation_number, - peer->next_index[LOCAL]); + * in the past, and they might still recover. + * + * We don't disconnect: they might send an error, meaning + * we will force-close the channel for them. + */ + peer_failed_warn_nodisconnect(peer->pps, + &peer->channel_id, + "bad reestablish revocation_number: %"PRIu64 + " vs %"PRIu64, + next_revocation_number, + peer->next_index[LOCAL]); } else if (next_revocation_number > peer->next_index[LOCAL] - 1) { if (!check_extra_fields) /* They don't support option_data_loss_protect or