|
|
|
@ -249,7 +249,8 @@ func (pm *ProtocolManager) newPeer(pv int, p *p2p.Peer, rw p2p.MsgReadWriter) *p |
|
|
|
|
// handle is the callback invoked to manage the life cycle of an eth peer. When
|
|
|
|
|
// this function terminates, the peer is disconnected.
|
|
|
|
|
func (pm *ProtocolManager) handle(p *peer) error { |
|
|
|
|
if pm.peers.Len() >= pm.maxPeers { |
|
|
|
|
// Ignore maxPeers if this is a trusted peer
|
|
|
|
|
if pm.peers.Len() >= pm.maxPeers && !p.Peer.Info().Network.Trusted { |
|
|
|
|
return p2p.DiscTooManyPeers |
|
|
|
|
} |
|
|
|
|
p.Log().Debug("Ethereum peer connected", "name", p.Name()) |
|
|
|
|