@@ -195,7 +195,11 @@ private boolean registerDisconnect(
195195 disconnectCallbacks .forEach (callback -> callback .onDisconnect (peer ));
196196 peer .handleDisconnect ();
197197 abortPendingRequestsAssignedToDisconnectedPeers ();
198- LOG .debug ("Disconnected EthPeer {}" , peer .getShortNodeId ());
198+ if (System .currentTimeMillis () - peer .getConnection ().getInitiatedAt () > 600000 ) {
199+ LOG .debug ("Disonnected ESTABLISHED peer {}" , peer );
200+ } else {
201+ LOG .debug ("Disconnected EthPeer {}" , peer .getShortNodeId ());
202+ }
199203 LOG .trace ("Disconnected EthPeer {}" , peer );
200204 }
201205 }
@@ -218,9 +222,8 @@ private void abortPendingRequestsAssignedToDisconnectedPeers() {
218222 }
219223
220224 public EthPeer peer (final PeerConnection connection ) {
221- final EthPeer ethPeer = incompleteConnections .getIfPresent (
222- connection );
223- return ethPeer != null ? ethPeer : completeConnections .get (connection .getPeer ().getId ());
225+ final EthPeer ethPeer = incompleteConnections .getIfPresent (connection );
226+ return ethPeer != null ? ethPeer : completeConnections .get (connection .getPeer ().getId ());
224227 }
225228
226229 public EthPeer peer (final Bytes peerId ) {
@@ -363,7 +366,7 @@ public Stream<PeerConnection> getAllConnections() {
363366
364367 public boolean shouldConnect (final Peer peer , final boolean inbound ) {
365368 final Bytes id = peer .getId ();
366- if (peerCount () >= peerUpperBound && !canExceedPeerLimits (id ) ) {
369+ if (peerCount () >= peerUpperBound && !canExceedPeerLimits (id )) {
367370 return false ;
368371 }
369372 final EthPeer ethPeer = completeConnections .get (id );
0 commit comments