From c3f238dd5371961d309350fb0f9d5136c9fc6afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felf=C3=B6ldi=20Zsolt?= Date: Mon, 5 Feb 2018 14:41:53 +0100 Subject: les: limit LES peer count and improve peer configuration logic (#16010) * les: limit number of LES connections * eth, cmd/utils: light vs max peer configuration logic --- les/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'les/server.go') diff --git a/les/server.go b/les/server.go index ec2e44fec..85ebbf898 100644 --- a/les/server.go +++ b/les/server.go @@ -38,6 +38,7 @@ import ( ) type LesServer struct { + config *eth.Config protocolManager *ProtocolManager fcManager *flowcontrol.ClientManager // nil if our node is client only fcCostStats *requestCostStats @@ -62,6 +63,7 @@ func NewLesServer(eth *eth.Ethereum, config *eth.Config) (*LesServer, error) { } srv := &LesServer{ + config: config, protocolManager: pm, quitSync: quitSync, lesTopics: lesTopics, @@ -108,7 +110,7 @@ func (s *LesServer) Protocols() []p2p.Protocol { // Start starts the LES server func (s *LesServer) Start(srvr *p2p.Server) { - s.protocolManager.Start() + s.protocolManager.Start(s.config.LightPeers) for _, topic := range s.lesTopics { topic := topic go func() { -- cgit v1.2.3