diff options
author | Felföldi Zsolt <zsfelfoldi@gmail.com> | 2018-02-05 21:41:53 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-02-05 21:41:53 +0800 |
commit | c3f238dd5371961d309350fb0f9d5136c9fc6afa (patch) | |
tree | 8879532944de4818030c0e8630613e52885695b6 /les/server.go | |
parent | bc0666fb277be5e7d1fd7c5523a3b335b310a154 (diff) | |
download | go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar.gz go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar.bz2 go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar.lz go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar.xz go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.tar.zst go-tangerine-c3f238dd5371961d309350fb0f9d5136c9fc6afa.zip |
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
Diffstat (limited to 'les/server.go')
-rw-r--r-- | les/server.go | 4 |
1 files changed, 3 insertions, 1 deletions
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() { |