Skip to content

Commit

Permalink
Use previous version as default version for incoming handshakes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfornet committed Aug 21, 2020
1 parent 0d7d4af commit 7f8b199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chain/network/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl From<Handshake> for HandshakeV2 {
Self {
// In previous version of handshake, nodes usually sent the oldest supported version instead of their current version.
// Computing the current version of the other as the oldest version plus 4, but not letting go bigger than 33.
version: std::cmp::min(33, handshake_old.version.saturating_add(4)),
version: std::cmp::min(PROTOCOL_VERSION - 1, handshake_old.version.saturating_add(4)),
oldest_supported_version: handshake_old.version,
peer_id: handshake_old.peer_id,
target_peer_id: handshake_old.target_peer_id,
Expand Down

0 comments on commit 7f8b199

Please sign in to comment.