@@ -877,7 +877,6 @@ struct MsgHandleErrInternal {
877
877
shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
878
878
}
879
879
impl MsgHandleErrInternal {
880
- #[inline]
881
880
fn send_err_msg_no_close(err: String, channel_id: ChannelId) -> Self {
882
881
Self {
883
882
err: LightningError {
@@ -890,11 +889,11 @@ impl MsgHandleErrInternal {
890
889
shutdown_finish: None,
891
890
}
892
891
}
893
- #[inline]
892
+
894
893
fn from_no_close(err: msgs::LightningError) -> Self {
895
894
Self { err, closes_channel: false, shutdown_finish: None }
896
895
}
897
- #[inline]
896
+
898
897
fn from_finish_shutdown(
899
898
err: String, channel_id: ChannelId, shutdown_res: ShutdownResult,
900
899
channel_update: Option<msgs::ChannelUpdate>,
@@ -914,47 +913,33 @@ impl MsgHandleErrInternal {
914
913
shutdown_finish: Some((shutdown_res, channel_update)),
915
914
}
916
915
}
917
- #[inline]
918
- #[rustfmt::skip]
916
+
919
917
fn from_chan_no_close(err: ChannelError, channel_id: ChannelId) -> Self {
920
- Self {
921
- err: match err {
922
- ChannelError::Warn(msg) => LightningError {
923
- err: msg.clone(),
924
- action: msgs::ErrorAction::SendWarningMessage {
925
- msg: msgs::WarningMessage {
926
- channel_id,
927
- data: msg
928
- },
929
- log_level: Level::Warn,
930
- },
931
- },
932
- ChannelError::WarnAndDisconnect(msg) => LightningError {
933
- err: msg.clone(),
934
- action: msgs::ErrorAction::DisconnectPeerWithWarning {
935
- msg: msgs::WarningMessage {
936
- channel_id,
937
- data: msg
938
- },
939
- },
918
+ let err = match err {
919
+ ChannelError::Warn(msg) => LightningError {
920
+ err: msg.clone(),
921
+ action: msgs::ErrorAction::SendWarningMessage {
922
+ msg: msgs::WarningMessage { channel_id, data: msg },
923
+ log_level: Level::Warn,
940
924
},
941
- ChannelError::Ignore(msg) => LightningError {
942
- err: msg,
943
- action: msgs::ErrorAction::IgnoreError,
925
+ },
926
+ ChannelError::WarnAndDisconnect(msg) => LightningError {
927
+ err: msg.clone(),
928
+ action: msgs::ErrorAction::DisconnectPeerWithWarning {
929
+ msg: msgs::WarningMessage { channel_id, data: msg },
944
930
},
945
- ChannelError::Close((msg, _)) | ChannelError::SendError(msg) => LightningError {
946
- err: msg.clone(),
947
- action: msgs::ErrorAction::SendErrorMessage {
948
- msg: msgs::ErrorMessage {
949
- channel_id,
950
- data : msg
951
- },
952
- },
931
+ },
932
+ ChannelError::Ignore(msg) => {
933
+ LightningError { err: msg, action: msgs::ErrorAction::IgnoreError }
934
+ },
935
+ ChannelError::Close((msg, _)) | ChannelError::SendError(msg) => LightningError {
936
+ err : msg.clone(),
937
+ action: msgs::ErrorAction::SendErrorMessage {
938
+ msg: msgs::ErrorMessage { channel_id, data: msg },
953
939
},
954
940
},
955
- closes_channel: false,
956
- shutdown_finish: None,
957
- }
941
+ };
942
+ Self { err, closes_channel: false, shutdown_finish: None }
958
943
}
959
944
960
945
fn closes_channel(&self) -> bool {
0 commit comments