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) { 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.")
}
} }
} }