From de9c3bc629f7e712b3cd84b280db6a32b9bc7030 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Mon, 14 Dec 2020 16:22:22 -0500 Subject: Fix linting and add to CI --- eth/backend.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'eth/backend.go') diff --git a/eth/backend.go b/eth/backend.go index 728ec4d..9fb8f38 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -23,7 +23,6 @@ import ( "math/big" "runtime" "sync" - //"sync/atomic" "github.com/ava-labs/coreth/accounts" "github.com/ava-labs/coreth/consensus" @@ -53,6 +52,16 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) +// ProtocolVersions are the supported versions of the eth protocol (first is primary). +var ProtocolVersions = []uint{eth65, eth64, eth63} + +// Constants to match up protocol versions and messages +const ( + eth63 = 63 + eth64 = 64 + eth65 = 65 +) + type BackendCallbacks struct { OnQueryAcceptedBlock func() *types.Block } @@ -498,13 +507,13 @@ func (s *Ethereum) Start() error { s.startBloomHandlers(params.BloomBitsBlocks) // Figure out a max peers count based on the server limits - maxPeers := s.p2pServer.MaxPeers - if s.config.LightServ > 0 { - if s.config.LightPeers >= s.p2pServer.MaxPeers { - return fmt.Errorf("invalid peer config: light peer count (%d) >= total peer count (%d)", s.config.LightPeers, s.p2pServer.MaxPeers) - } - maxPeers -= s.config.LightPeers - } + // maxPeers := s.p2pServer.MaxPeers + // if s.config.LightServ > 0 { + // if s.config.LightPeers >= s.p2pServer.MaxPeers { + // return fmt.Errorf("invalid peer config: light peer count (%d) >= total peer count (%d)", s.config.LightPeers, s.p2pServer.MaxPeers) + // } + // maxPeers -= s.config.LightPeers + // } // Start the networking layer and the light server if requested //s.protocolManager.Start(maxPeers) return nil -- cgit v1.2.3