@@ -902,26 +902,31 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
902
902
Ok ( x) => x,
903
903
Err ( e) => {
904
904
match e {
905
- msgs:: DecodeError :: UnknownVersion => return Err ( PeerHandleError { no_connection_possible : false } ) ,
906
- msgs:: DecodeError :: UnknownRequiredFeature => {
905
+ ( msgs:: DecodeError :: UnknownRequiredFeature , _) => {
907
906
log_gossip ! ( self . logger, "Got a channel/node announcement with an unknown required feature flag, you may want to update!" ) ;
908
907
continue ;
909
908
}
910
- msgs:: DecodeError :: InvalidValue => {
909
+ ( msgs:: DecodeError :: UnsupportedCompression , _) => {
910
+ log_gossip ! ( self . logger, "We don't support zlib-compressed message fields, sending a warning and ignoring message" ) ;
911
+ self . enqueue_message ( peer, & msgs:: WarningMessage { channel_id : [ 0 ; 32 ] , data : "Unsupported message compression: zlib" . to_owned ( ) } ) ;
912
+ continue ;
913
+ }
914
+ ( _, Some ( ty) ) if is_gossip_msg ( ty) => {
915
+ log_gossip ! ( self . logger, "Got an invalid value while deserializing a gossip message" ) ;
916
+ self . enqueue_message ( peer, & msgs:: WarningMessage { channel_id : [ 0 ; 32 ] , data : "Unreadable/bogus gossip message" . to_owned ( ) } ) ;
917
+ continue ;
918
+ }
919
+ ( msgs:: DecodeError :: UnknownVersion , _) => return Err ( PeerHandleError { no_connection_possible : false } ) ,
920
+ ( msgs:: DecodeError :: InvalidValue , _) => {
911
921
log_debug ! ( self . logger, "Got an invalid value while deserializing message" ) ;
912
922
return Err ( PeerHandleError { no_connection_possible : false } ) ;
913
923
}
914
- msgs:: DecodeError :: ShortRead => {
924
+ ( msgs:: DecodeError :: ShortRead , _ ) => {
915
925
log_debug ! ( self . logger, "Deserialization failed due to shortness of message" ) ;
916
926
return Err ( PeerHandleError { no_connection_possible : false } ) ;
917
927
}
918
- msgs:: DecodeError :: BadLengthDescriptor => return Err ( PeerHandleError { no_connection_possible : false } ) ,
919
- msgs:: DecodeError :: Io ( _) => return Err ( PeerHandleError { no_connection_possible : false } ) ,
920
- msgs:: DecodeError :: UnsupportedCompression => {
921
- log_gossip ! ( self . logger, "We don't support zlib-compressed message fields, sending a warning and ignoring message" ) ;
922
- self . enqueue_message ( peer, & msgs:: WarningMessage { channel_id : [ 0 ; 32 ] , data : "Unsupported message compression: zlib" . to_owned ( ) } ) ;
923
- continue ;
924
- }
928
+ ( msgs:: DecodeError :: BadLengthDescriptor , _) => return Err ( PeerHandleError { no_connection_possible : false } ) ,
929
+ ( msgs:: DecodeError :: Io ( _) , _) => return Err ( PeerHandleError { no_connection_possible : false } ) ,
925
930
}
926
931
}
927
932
} ;
0 commit comments