diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-12 22:36:14 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-12 22:36:14 +0800 |
commit | cc341b8734cf2c424b9b4adf7861400992755d7a (patch) | |
tree | 6b8a99668beb7de4f9c433b8d39cc9b3aa682116 | |
parent | 52b664b0aec24bffc040da06bbe8be1d3e7e4ab8 (diff) | |
download | go-tangerine-cc341b8734cf2c424b9b4adf7861400992755d7a.tar.gz go-tangerine-cc341b8734cf2c424b9b4adf7861400992755d7a.tar.zst go-tangerine-cc341b8734cf2c424b9b4adf7861400992755d7a.zip |
Added debug message if you try to add a peer when max peers has been reached.
-rw-r--r-- | ethereum.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go index 0f5bd11a2..bd391ba37 100644 --- a/ethereum.go +++ b/ethereum.go @@ -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.") + } } } |