Behaviour change:

In the 3rd attempt we filter for
INITIAL_DATA_EXCHANGE peers.
Before we excluded 2 types and as PEER have been
already filtered earlier we would look up for SEED_NODE.
This was only called by non-seedNodes.
This commit is contained in:
chimp1984 2021-01-05 21:10:45 -05:00
parent 4d64fac401
commit cf4d89dea2
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -535,8 +535,7 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
"Lets try to remove any connection which is not " +
"of type DIRECT_MSG_PEER or INITIAL_DATA_REQUEST.", maxConnectionsNonDirect);
candidates = allConnections.stream()
.filter(e -> e.getConnectionState().getPeerType() != PeerType.DIRECT_MSG_PEER &&
e.getConnectionState().getPeerType() != PeerType.INITIAL_DATA_EXCHANGE)
.filter(e -> e.getConnectionState().getPeerType() == PeerType.INITIAL_DATA_EXCHANGE)
.sorted(Comparator.comparingLong(o -> o.getConnectionState().getLastInitialDataMsgTimeStamp()))
.collect(Collectors.toList());