@@ -195,7 +195,11 @@ private boolean registerDisconnect(
195
195
disconnectCallbacks .forEach (callback -> callback .onDisconnect (peer ));
196
196
peer .handleDisconnect ();
197
197
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
+ }
199
203
LOG .trace ("Disconnected EthPeer {}" , peer );
200
204
}
201
205
}
@@ -218,9 +222,8 @@ private void abortPendingRequestsAssignedToDisconnectedPeers() {
218
222
}
219
223
220
224
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 ());
224
227
}
225
228
226
229
public EthPeer peer (final Bytes peerId ) {
@@ -363,7 +366,7 @@ public Stream<PeerConnection> getAllConnections() {
363
366
364
367
public boolean shouldConnect (final Peer peer , final boolean inbound ) {
365
368
final Bytes id = peer .getId ();
366
- if (peerCount () >= peerUpperBound && !canExceedPeerLimits (id ) ) {
369
+ if (peerCount () >= peerUpperBound && !canExceedPeerLimits (id )) {
367
370
return false ;
368
371
}
369
372
final EthPeer ethPeer = completeConnections .get (id );
0 commit comments