diff --git a/p2p/peer_error.go b/p2p/peer_error.go index ab61bfef06..d3cf994f04 100644 --- a/p2p/peer_error.go +++ b/p2p/peer_error.go @@ -69,23 +69,25 @@ const ( DiscUnexpectedIdentity DiscSelf DiscReadTimeout + DiscTooManyInboundConnections DiscSubprotocolError = 0x10 ) var discReasonToString = [...]string{ - DiscRequested: "disconnect requested", - DiscNetworkError: "network error", - DiscProtocolError: "breach of protocol", - DiscUselessPeer: "useless peer", - DiscTooManyPeers: "too many peers", - DiscAlreadyConnected: "already connected", - DiscIncompatibleVersion: "incompatible p2p protocol version", - DiscInvalidIdentity: "invalid node identity", - DiscQuitting: "client quitting", - DiscUnexpectedIdentity: "unexpected identity", - DiscSelf: "connected to self", - DiscReadTimeout: "read timeout", - DiscSubprotocolError: "subprotocol error", + DiscRequested: "disconnect requested", + DiscNetworkError: "network error", + DiscProtocolError: "breach of protocol", + DiscUselessPeer: "useless peer", + DiscTooManyPeers: "too many peers", + DiscTooManyInboundConnections: "too many inbound connections", + DiscAlreadyConnected: "already connected", + DiscIncompatibleVersion: "incompatible p2p protocol version", + DiscInvalidIdentity: "invalid node identity", + DiscQuitting: "client quitting", + DiscUnexpectedIdentity: "unexpected identity", + DiscSelf: "connected to self", + DiscReadTimeout: "read timeout", + DiscSubprotocolError: "subprotocol error", } func (d DiscReason) String() string { diff --git a/p2p/server.go b/p2p/server.go index 566f01ffc5..79dbd6ab50 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -794,7 +794,7 @@ func (srv *Server) encHandshakeChecks(peers map[enode.ID]*Peer, inboundCount int case !c.is(trustedConn|staticDialedConn) && len(peers) >= srv.MaxPeers: return DiscTooManyPeers case !c.is(trustedConn) && c.is(inboundConn) && inboundCount >= srv.maxInboundConns(): - return DiscTooManyPeers + return DiscTooManyInboundConnections case peers[c.node.ID()] != nil: return DiscAlreadyConnected case c.node.ID() == srv.localnode.ID():