mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-06 11:25:02 +00:00
eth: allow setting maxpeers dynamically
This commit is contained in:
parent
4644443b10
commit
2619478ae9
1 changed files with 6 additions and 0 deletions
|
|
@ -410,6 +410,12 @@ func (s *Ethereum) Start() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Ethereum) setMaxPeers(max int) {
|
||||
s.p2pServer.MaxPeers = max
|
||||
s.handler.SetMaxPeers(max)
|
||||
s.dropper.SetMaxPeers(s.p2pServer.MaxDialedConns(), s.p2pServer.MaxInboundConns())
|
||||
}
|
||||
|
||||
func (s *Ethereum) newChainView(head *types.Header) *filtermaps.ChainView {
|
||||
if head == nil {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue