Skip to content

Commit

Permalink
channeld: don't hang up immediately after sending bad reestablish war…
Browse files Browse the repository at this point in the history
…ning.

This gives the peer a chance to send an error, which will make us drop
to chain.

Signed-off-by: Rusty Russell <[email protected]>
Fixes: ElementsProject#5818
  • Loading branch information
rustyrussell committed Oct 22, 2023
1 parent a5bd950 commit 863f8fb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 863f8fb

Please sign in to comment.