From: Alec Chen Date: Mon, 3 Jun 2024 22:03:46 +0000 (-0500) Subject: Don't disconnect on manual force closes X-Git-Tag: v0.0.124-beta~101^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=eb84e4cb5411330ad99672f0e73e2e5c2017d394;p=rust-lightning Don't disconnect on manual force closes --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 86d5bcb73..86254c1c8 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -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 } }, } ); diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index c33c21be4..7cd0f376d 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -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); diff --git a/lightning/src/ln/reload_tests.rs b/lightning/src/ln/reload_tests.rs index 4b747046e..4c32a0bd0 100644 --- a/lightning/src/ln/reload_tests.rs +++ b/lightning/src/ln/reload_tests.rs @@ -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!"), }