Skip to content

Commit bb79e05

Browse files
committed
f reorder new error match
1 parent a1449ae commit bb79e05

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,21 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
902902
Ok(x) => x,
903903
Err(e) => {
904904
match e {
905+
(msgs::DecodeError::UnknownRequiredFeature, _) => {
906+
log_gossip!(self.logger, "Got a channel/node announcement with an unknown required feature flag, you may want to update!");
907+
continue;
908+
}
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+
}
905914
(_, Some(ty)) if is_gossip_msg(ty) => {
906915
log_gossip!(self.logger, "Got an invalid value while deserializing a gossip message");
907916
self.enqueue_message(peer, &msgs::WarningMessage { channel_id: [0; 32], data: "Unreadable/bogus gossip message".to_owned() });
908917
continue;
909918
}
910919
(msgs::DecodeError::UnknownVersion, _) => return Err(PeerHandleError { no_connection_possible: false }),
911-
(msgs::DecodeError::UnknownRequiredFeature, _) => {
912-
log_gossip!(self.logger, "Got a channel/node announcement with an unknown required feature flag, you may want to update!");
913-
continue;
914-
}
915920
(msgs::DecodeError::InvalidValue, _) => {
916921
log_debug!(self.logger, "Got an invalid value while deserializing message");
917922
return Err(PeerHandleError { no_connection_possible: false });
@@ -922,11 +927,6 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
922927
}
923928
(msgs::DecodeError::BadLengthDescriptor, _) => return Err(PeerHandleError { no_connection_possible: false }),
924929
(msgs::DecodeError::Io(_), _) => return Err(PeerHandleError { no_connection_possible: false }),
925-
(msgs::DecodeError::UnsupportedCompression, _) => {
926-
log_gossip!(self.logger, "We don't support zlib-compressed message fields, sending a warning and ignoring message");
927-
self.enqueue_message(peer, &msgs::WarningMessage { channel_id: [0; 32], data: "Unsupported message compression: zlib".to_owned() });
928-
continue;
929-
}
930930
}
931931
}
932932
};

0 commit comments

Comments
 (0)