aboutsummaryrefslogtreecommitdiff
path: root/eth/backend.go
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-12-17 17:13:04 -0500
committerGitHub <[email protected]>2020-12-17 17:13:04 -0500
commit374b401198759f23bac435a78c5b1fa2c516aad9 (patch)
treef3d33fa99fc7d46dd2836bef500d8a1cf445e094 /eth/backend.go
parentc765f9b5b38d3e4b5f4261d3c4ab776dd9c3c97a (diff)
parent72f10d245f5514de4f586ca97784d599d00cc8f3 (diff)
Merge pull request #72 from ava-labs/devHEADv0.3.17master
Dev
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go25
1 files changed, 17 insertions, 8 deletions
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