aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
Diffstat (limited to 'les')
-rw-r--r--les/backend.go5
-rw-r--r--les/protocol.go5
-rw-r--r--les/server.go4
3 files changed, 7 insertions, 7 deletions
diff --git a/les/backend.go b/les/backend.go
index 7180b81d7..798e44e85 100644
--- a/les/backend.go
+++ b/les/backend.go
@@ -221,9 +221,8 @@ 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()
return nil
diff --git a/les/protocol.go b/les/protocol.go
index 05e6654d6..6a7354d1c 100644
--- a/les/protocol.go
+++ b/les/protocol.go
@@ -41,8 +41,9 @@ const (
// Supported versions of the les protocol (first is primary)
var (
- ClientProtocolVersions = []uint{lpv2, lpv1}
- ServerProtocolVersions = []uint{lpv2, lpv1}
+ ClientProtocolVersions = []uint{lpv2, lpv1}
+ ServerProtocolVersions = []uint{lpv2, lpv1}
+ AdvertiseProtocolVersions = []uint{lpv2} // clients are searching for the first advertised protocol in the list
)
// Number of implemented message corresponding to different protocol versions.
diff --git a/les/server.go b/les/server.go
index d8f93cd87..ec2e44fec 100644
--- a/les/server.go
+++ b/les/server.go
@@ -56,8 +56,8 @@ func NewLesServer(eth *eth.Ethereum, config *eth.Config) (*LesServer, error) {
return nil, err
}
- lesTopics := make([]discv5.Topic, len(ServerProtocolVersions))
- for i, pv := range ServerProtocolVersions {
+ lesTopics := make([]discv5.Topic, len(AdvertiseProtocolVersions))
+ for i, pv := range AdvertiseProtocolVersions {
lesTopics[i] = lesTopic(eth.BlockChain().Genesis().Hash(), pv)
}