mirror of
https://github.com/Qortal/qortal.git
synced 2025-06-19 14:11:22 +00:00
Removed missed functional change
This commit is contained in:
parent
265d40f04a
commit
de4b1c8f09
@ -35,8 +35,6 @@ import java.util.function.Function;
|
|||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.qortal.controller.Controller.MISBEHAVIOUR_COOLOFF;
|
|
||||||
|
|
||||||
// For managing peers
|
// For managing peers
|
||||||
public class Network {
|
public class Network {
|
||||||
private static final Logger LOGGER = LogManager.getLogger(Network.class);
|
private static final Logger LOGGER = LogManager.getLogger(Network.class);
|
||||||
@ -267,11 +265,6 @@ public class Network {
|
|||||||
return this.connectedPeers.stream().anyMatch(peer -> peer.getPeerData().getAddress().equals(peerAddress));
|
return this.connectedPeers.stream().anyMatch(peer -> peer.getPeerData().getAddress().equals(peerAddress));
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final Predicate<PeerData> hasMisbehaved = peerData -> {
|
|
||||||
final Long lastMisbehaved = peerData.getLastMisbehaved();
|
|
||||||
return lastMisbehaved != null && lastMisbehaved > NTP.getTime() - MISBEHAVIOUR_COOLOFF;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Must be inside <tt>synchronized (this.connectedPeers) {...}</tt>
|
* Must be inside <tt>synchronized (this.connectedPeers) {...}</tt>
|
||||||
*/
|
*/
|
||||||
@ -571,8 +564,6 @@ public class Network {
|
|||||||
|| peerData.getLastConnected() < peerData.getLastAttempted())
|
|| peerData.getLastConnected() < peerData.getLastAttempted())
|
||||||
&& peerData.getLastAttempted() > lastAttemptedThreshold);
|
&& peerData.getLastAttempted() > lastAttemptedThreshold);
|
||||||
|
|
||||||
peers.removeIf(hasMisbehaved);
|
|
||||||
|
|
||||||
// Don't consider peers that we know loop back to ourself
|
// Don't consider peers that we know loop back to ourself
|
||||||
synchronized (this.selfPeers) {
|
synchronized (this.selfPeers) {
|
||||||
peers.removeIf(isSelfPeer);
|
peers.removeIf(isSelfPeer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user