Skip to main content

negotiate_version

Function negotiate_version 

Source
pub fn negotiate_version(theirs: u32) -> Result<u32, ProtocolError>
Expand description

Returns this build’s protocol version if theirs is compatible, else a ProtocolError::VersionMismatch.

v1 speaks exactly one version, so compatibility is equality; a later minor-compatible range widens this without changing the call sites.

§Errors

Returns ProtocolError::VersionMismatch when the peer’s version is not compatible.