From 449846ccb2bc222d070e19b7a329aef2823f81b6 Mon Sep 17 00:00:00 2001 From: needkane <604476380@qq.com> Date: Wed, 18 Jul 2018 17:12:52 +0800 Subject: [PATCH] NodeInfo version check: delete redundant code --- p2p/node_info.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/p2p/node_info.go b/p2p/node_info.go index 5e8160a3b..fa1333b27 100644 --- a/p2p/node_info.go +++ b/p2p/node_info.go @@ -2,8 +2,9 @@ package p2p import ( "fmt" - cmn "github.com/tendermint/tendermint/libs/common" "strings" + + cmn "github.com/tendermint/tendermint/libs/common" ) const ( @@ -81,8 +82,8 @@ func (info NodeInfo) Validate() error { // CONTRACT: two nodes are compatible if the major version matches and network match // and they have at least one channel in common. func (info NodeInfo) CompatibleWith(other NodeInfo) error { - iMajor, iMinor, _, iErr := splitVersion(info.Version) - oMajor, oMinor, _, oErr := splitVersion(other.Version) + iMajor, _, _, iErr := splitVersion(info.Version) + oMajor, _, _, oErr := splitVersion(other.Version) // if our own version number is not formatted right, we messed up if iErr != nil { @@ -99,11 +100,6 @@ func (info NodeInfo) CompatibleWith(other NodeInfo) error { return fmt.Errorf("Peer is on a different major version. Got %v, expected %v", oMajor, iMajor) } - // minor version can differ - if iMinor != oMinor { - // ok - } - // nodes must be on the same network if info.Network != other.Network { return fmt.Errorf("Peer is on a different network. Got %v, expected %v", other.Network, info.Network)