]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Mention lnd's SCB feature in the corresponding error message 2023-05-better-scb-err
authorMatt Corallo <git@bluematt.me>
Fri, 5 May 2023 00:13:25 +0000 (00:13 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 5 May 2023 00:13:25 +0000 (00:13 +0000)
It's a bit confusing when we see only "Peer sent a garbage
channel_reestablish" when a peer uses lnd's SCB feature to ask us
to broadcast the latest state. This updates the error message to be
a bit clearer.

lightning/src/ln/channel.rs

index 4fd612a4b91e33c99659c46e592bf6b22d70a3ec..5ba3ab83ddc0f69ca0ecbd2c6287ffeb836bf8e0 100644 (file)
@@ -4092,7 +4092,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
 
                if msg.next_local_commitment_number >= INITIAL_COMMITMENT_NUMBER || msg.next_remote_commitment_number >= INITIAL_COMMITMENT_NUMBER ||
                        msg.next_local_commitment_number == 0 {
-                       return Err(ChannelError::Close("Peer sent a garbage channel_reestablish".to_owned()));
+                       return Err(ChannelError::Close("Peer sent a garbage channel_reestablish (usually an lnd node with lost state asking us to force-close for them)".to_owned()));
                }
 
                if msg.next_remote_commitment_number > 0 {