Skip to main content

check_version

Function check_version 

pub fn check_version(
    local: ProtocolVersion,
    remote: ProtocolVersion,
) -> Result<(), VersionMismatch>
Expand description

Accept the peer when the protocol major versions match.

§Arguments

  • local - This endpoint’s protocol version.
  • remote - The peer’s advertised protocol version.

§Returns

Ok(()) when the major versions match; a differing minor is compatible.

§Errors

Returns VersionMismatch when the major versions differ.