+ Err(e) => { message_err = Err(e); },
+ }
+
+ match message_err {
+ Ok(()) => {},
+ Err(e) => match e {
+ msgs::DecodeError::UnknownVersion => return Err(PeerHandleError { no_connection_possible: false }),
+ msgs::DecodeError::UnknownRequiredFeature => {
+ log_trace!(self.logger, "Got a channel/node announcement with an known required feature flag, you may want to update!");
+ continue;
+ }
+ msgs::DecodeError::InvalidValue => {
+ log_debug!(self.logger, "Got an invalid value while deserializing message");
+ return Err(PeerHandleError { no_connection_possible: false });
+ }
+ msgs::DecodeError::ShortRead => {
+ log_debug!(self.logger, "Deserialization failed due to shortness of message");
+ return Err(PeerHandleError { no_connection_possible: false });
+ }
+ msgs::DecodeError::BadLengthDescriptor => return Err(PeerHandleError { no_connection_possible: false }),
+ msgs::DecodeError::Io(_) => return Err(PeerHandleError { no_connection_possible: false }),
+ msgs::DecodeError::UnsupportedCompression => {
+ log_trace!(self.logger, "We don't support zlib-compressed message fields, ignoring message");
+ continue;
+ }
+ },
+ }
+
+ match handle_err {
+ Ok(()) => {},
+ Err(e) =>
+ match e {
+ MessageHandlingError::PeerHandleError(e) => { return Err(e) },
+ MessageHandlingError::LightningError(e) => {
+ try_potential_handleerror!(Err(e));
+ }
+ }