]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't disconnect on manual force closes
authorAlec Chen <alecchendev@gmail.com>
Mon, 3 Jun 2024 22:03:46 +0000 (17:03 -0500)
committerAlec Chen <alecchendev@gmail.com>
Mon, 3 Jun 2024 22:03:46 +0000 (17:03 -0500)
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/reload_tests.rs

index 86d5bcb7318f42e2a9d8e0e7e3475411f9212ac4..86254c1c890e06defec018b3b526d47dd2af23a0 100644 (file)
@@ -3714,8 +3714,8 @@ where
                                        peer_state.pending_msg_events.push(
                                                events::MessageSendEvent::HandleError {
                                                        node_id: counterparty_node_id,
-                                                       action: msgs::ErrorAction::DisconnectPeer {
-                                                               msg: Some(msgs::ErrorMessage { channel_id: *channel_id, data: error_message})
+                                                       action: msgs::ErrorAction::SendErrorMessage {
+                                                               msg: msgs::ErrorMessage { channel_id: *channel_id, data: error_message }
                                                        },
                                                }
                                        );
index c33c21be45ce1879a0cfff3333d4e58c3ba3311c..7cd0f376d2e431d1fe8fe56c5353d281dbf28e55 100644 (file)
@@ -11136,7 +11136,7 @@ fn do_test_funding_and_commitment_tx_confirm_same_block(confirm_remote_commitmen
        let mut msg_events = closing_node.node.get_and_clear_pending_msg_events();
        assert_eq!(msg_events.len(), 1);
        match msg_events.pop().unwrap() {
-               MessageSendEvent::HandleError { action: msgs::ErrorAction::DisconnectPeer { .. }, .. } => {},
+               MessageSendEvent::HandleError { action: msgs::ErrorAction::SendErrorMessage { .. }, .. } => {},
                _ => panic!("Unexpected event"),
        }
        check_added_monitors(closing_node, 1);
index 4b747046e74818323dc8c30d44f120806afd94d9..4c32a0bd0700730f3046c2976cb1ab617e58d5ef 100644 (file)
@@ -643,8 +643,8 @@ fn do_test_data_loss_protect(reconnect_panicing: bool, substantially_old: bool,
                        if let MessageSendEvent::BroadcastChannelUpdate { .. } = msg {
                        } else if let MessageSendEvent::HandleError { ref action, .. } = msg {
                                match action {
-                                       &ErrorAction::DisconnectPeer { ref msg } => {
-                                               assert_eq!(msg.as_ref().unwrap().data, "Channel force-closed");
+                                       &ErrorAction::SendErrorMessage { ref msg } => {
+                                               assert_eq!(&msg.data, "Channel force-closed");
                                        },
                                        _ => panic!("Unexpected event!"),
                                }