forked from cerc-io/plugeth
Added debug message if you try to add a peer when max peers has been reached.
This commit is contained in:
parent
52b664b0ae
commit
cc341b8734
10
ethereum.go
10
ethereum.go
@ -132,9 +132,13 @@ func (s *Ethereum) ServerCaps() Caps {
|
|||||||
func (s *Ethereum) AddPeer(conn net.Conn) {
|
func (s *Ethereum) AddPeer(conn net.Conn) {
|
||||||
peer := NewPeer(conn, s, true)
|
peer := NewPeer(conn, s, true)
|
||||||
|
|
||||||
if peer != nil && s.peers.Len() < s.MaxPeers {
|
if peer != nil {
|
||||||
s.peers.PushBack(peer)
|
if s.peers.Len() < s.MaxPeers {
|
||||||
peer.Start()
|
s.peers.PushBack(peer)
|
||||||
|
peer.Start()
|
||||||
|
} else {
|
||||||
|
ethutil.Config.Log.Debugf("[SERV] Max connected peers reached. Not adding incoming peer.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user