aboutsummaryrefslogtreecommitdiffstats
path: root/les/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'les/backend.go')
-rw-r--r--les/backend.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/les/backend.go b/les/backend.go
index 7180b81d7..6a324cb04 100644
--- a/les/backend.go
+++ b/les/backend.go
@@ -46,6 +46,8 @@ import (
)
type LightEthereum struct {
+ config *eth.Config
+
odr *LesOdr
relay *LesTxRelay
chainConfig *params.ChainConfig
@@ -92,6 +94,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
quitSync := make(chan struct{})
leth := &LightEthereum{
+ config: config,
chainConfig: chainConfig,
chainDb: chainDb,
eventMux: ctx.EventMux,
@@ -221,11 +224,10 @@ func (s *LightEthereum) Start(srvr *p2p.Server) error {
s.startBloomHandlers()
log.Warn("Light client mode is an experimental feature")
s.netRPCService = ethapi.NewPublicNetAPI(srvr, s.networkId)
- // search the topic belonging to the oldest supported protocol because
- // servers always advertise all supported protocols
- protocolVersion := ClientProtocolVersions[len(ClientProtocolVersions)-1]
+ // clients are searching for the first advertised protocol in the list
+ protocolVersion := AdvertiseProtocolVersions[0]
s.serverPool.start(srvr, lesTopic(s.blockchain.Genesis().Hash(), protocolVersion))
- s.protocolManager.Start()
+ s.protocolManager.Start(s.config.LightPeers)
return nil
}