diff --git a/zebra-network/src/peer/handshake.rs b/zebra-network/src/peer/handshake.rs index 5446ec13b7a..fd6750f85fe 100644 --- a/zebra-network/src/peer/handshake.rs +++ b/zebra-network/src/peer/handshake.rs @@ -567,17 +567,9 @@ pub async fn negotiate_version( Err(HandshakeError::NonceReuse)?; } - // TODO: Reject connections with nodes that don't know about the current network upgrade (#1334) - // Use the latest non-finalized block height, rather than the minimum - if remote_version - < Version::min_remote_for_height( - config.network, - // This code will be replaced in #1334 - constants::INITIAL_MIN_NETWORK_PROTOCOL_VERSION - .activation_height(config.network) - .expect("minimum network protocol network upgrade has an activation height"), - ) - { + let tip_height = best_tip_height.non_finalized(); + let min_version = Version::min_remote_for_height(config.network, tip_height); + if remote_version < min_version { // Disconnect if peer is using an obsolete version. Err(HandshakeError::ObsoleteVersion(remote_version))?; }