Added debug message if you try to add a peer when max peers has been reached.

This commit is contained in:
Maran 2014-05-12 16:36:14 +02:00
parent 52b664b0ae
commit cc341b8734

View File

@ -132,9 +132,13 @@ func (s *Ethereum) ServerCaps() Caps {
func (s *Ethereum) AddPeer(conn net.Conn) {
peer := NewPeer(conn, s, true)
if peer != nil && s.peers.Len() < s.MaxPeers {
s.peers.PushBack(peer)
peer.Start()
if peer != nil {
if s.peers.Len() < s.MaxPeers {
s.peers.PushBack(peer)
peer.Start()
} else {
ethutil.Config.Log.Debugf("[SERV] Max connected peers reached. Not adding incoming peer.")
}
}
}