mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactoring: Rename INITIAL_DATA_REQUEST to INITIAL_DATA_EXCHANGE
This commit is contained in:
parent
15cd42de0c
commit
809484e65d
@ -861,7 +861,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
||||
statistic.updateLastActivityTimestamp();
|
||||
|
||||
if (networkEnvelope instanceof GetDataRequest)
|
||||
setPeerType(PeerType.INITIAL_DATA_REQUEST);
|
||||
setPeerType(PeerType.INITIAL_DATA_EXCHANGE);
|
||||
|
||||
// First a seed node gets a message from a peer (PreliminaryDataRequest using
|
||||
// AnonymousMessage interface) which does not have its hidden service
|
||||
|
@ -21,5 +21,5 @@ public enum PeerType {
|
||||
SEED_NODE,
|
||||
PEER,
|
||||
DIRECT_MSG_PEER,
|
||||
INITIAL_DATA_REQUEST
|
||||
INITIAL_DATA_EXCHANGE
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ public final class PeerManager implements ConnectionListener, PersistedDataHost
|
||||
"of type DIRECT_MSG_PEER or INITIAL_DATA_REQUEST.", maxConnectionsNonDirect);
|
||||
candidates = allConnections.stream()
|
||||
.filter(e -> e.getPeerType() != PeerType.DIRECT_MSG_PEER &&
|
||||
e.getPeerType() != PeerType.INITIAL_DATA_REQUEST)
|
||||
e.getPeerType() != PeerType.INITIAL_DATA_EXCHANGE)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (candidates.isEmpty()) {
|
||||
|
@ -159,7 +159,7 @@ public class PeerManagerTest {
|
||||
assertEquals(maxConnectionsNonDirect + 1, node.getNetworkNode().getAllConnections().size());
|
||||
List<Connection> sortedPeerConnections = node.getNetworkNode().getAllConnections().stream()
|
||||
.filter(e -> e.getPeerType() != PeerType.DIRECT_MSG_PEER &&
|
||||
e.getPeerType() != PeerType.INITIAL_DATA_REQUEST)
|
||||
e.getPeerType() != PeerType.INITIAL_DATA_EXCHANGE)
|
||||
.sorted(Comparator.comparingLong(o -> o.getStatistic().getLastActivityTimestamp()))
|
||||
.collect(Collectors.toList());
|
||||
Connection oldestConnection = sortedPeerConnections.remove(0);
|
||||
|
Loading…
Reference in New Issue
Block a user