mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 04:42:34 +00:00
complete match for has_context_bytes
This commit is contained in:
@@ -408,15 +408,12 @@ impl ProtocolId {
|
||||
/// Returns `true` if the given `ProtocolId` should expect `context_bytes` in the
|
||||
/// beginning of the stream, else returns `false`.
|
||||
pub fn has_context_bytes(&self) -> bool {
|
||||
match self.version {
|
||||
Version::V2 => matches!(
|
||||
self.message_name,
|
||||
Protocol::BlocksByRange | Protocol::BlocksByRoot
|
||||
),
|
||||
Version::V1 => matches!(
|
||||
self.message_name,
|
||||
Protocol::BlobsByRange | Protocol::BlobsByRoot
|
||||
),
|
||||
match self.message_name {
|
||||
Protocol::BlocksByRange | Protocol::BlocksByRoot => {
|
||||
!matches!(self.version, Version::V1)
|
||||
}
|
||||
Protocol::BlobsByRange | Protocol::BlobsByRoot | Protocol::LightClientBootstrap => true,
|
||||
Protocol::Goodbye | Protocol::Ping | Protocol::Status | Protocol::MetaData => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user