Send warning messages when repeating shutdown messages at volume
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 9794dc905f4c62a8bea91f71ea56bea56be15678..15f536789bf43713279e5e231e415d26bf5b1129 100644 (file)
@@ -7512,6 +7512,16 @@ where
                                                                msg,
                                                        });
                                                }
+                                               peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
+                                                       node_id: *counterparty_node_id,
+                                                       action: msgs::ErrorAction::SendWarningMessage {
+                                                               msg: msgs::WarningMessage {
+                                                                       channel_id: msg.channel_id,
+                                                                       data: "You appear to be exhibiting LND bug 6039, we'll keep sending you shutdown messages until you handle them correctly".to_owned()
+                                                               },
+                                                               log_level: Level::Trace,
+                                                       }
+                                               });
                                        }
                                }
                                return;