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