mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
les: only advertise and search for LES2 topic
This commit is contained in:
parent
9a61c871a4
commit
313384f474
3 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue