Skip to content

Commit

Permalink
simplify eth compatible protocol logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Jul 7, 2024
1 parent 2f2d15f commit 2a324d5
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions eth/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,13 @@ const (
// try to follow the exact comparison from go-ethereum as much as possible (eg. version >= 63 <> isEth63OrHigher(version))

func isEth63(version int) bool {
switch {
case version == 63:
return true
case version == 100:
return true
default:
return false
}
return version == xdpos2 || version == eth63
}
func isEth64(version int) bool {
switch {
case version == 64:
return true
default:
return false
}
return version == eth64
}
func isEth65(version int) bool {
switch {
case version == 65:
return true
case version == 101:
return true
default:
return false
}
return version == xdpos22 || version == eth65
}

func isEth63OrHigher(version int) bool {
Expand All @@ -86,7 +67,6 @@ func isEth65OrHigher(version int) bool {
// protocolName is the official short name of the protocol used during capability negotiation.
const protocolName = "eth"

// ProtocolVersions are the supported versions of the eth protocol (first is primary).
var ProtocolVersions = []uint{xdpos22, xdpos2, eth65, eth64, eth63}

// protocolLengths are the number of implemented message corresponding to different protocol versions.
Expand Down

0 comments on commit 2a324d5

Please sign in to comment.