Browse Source

Added logs to intentional disconnects

pull/40/head
Istvan Szabo 3 years ago
parent
commit
d52875aa8f
  1. 5
      src/main/java/org/qortal/network/Network.java

5
src/main/java/org/qortal/network/Network.java

@ -526,8 +526,8 @@ public class Network {
List<String> fixedNetwork = Settings.getInstance().getFixedNetwork(); List<String> fixedNetwork = Settings.getInstance().getFixedNetwork();
if (fixedNetwork != null && !fixedNetwork.isEmpty() && ipNotInFixedList(address, fixedNetwork)) { if (fixedNetwork != null && !fixedNetwork.isEmpty() && ipNotInFixedList(address, fixedNetwork)) {
try { try {
socketChannel.close();
LOGGER.debug("Connection discarded from peer {} as not in the fixed network list", address); LOGGER.debug("Connection discarded from peer {} as not in the fixed network list", address);
socketChannel.close();
} catch (IOException e) { } catch (IOException e) {
// IGNORE // IGNORE
} }
@ -547,7 +547,7 @@ public class Network {
synchronized (this.connectedPeers) { synchronized (this.connectedPeers) {
if (connectedPeers.size() >= maxPeers) { if (connectedPeers.size() >= maxPeers) {
// We have enough peers // We have enough peers
LOGGER.debug("Connection discarded from peer {}", address); LOGGER.debug("Connection discarded from peer {} because the server is full", address);
socketChannel.close(); socketChannel.close();
return; return;
} }
@ -560,6 +560,7 @@ public class Network {
} catch (IOException e) { } catch (IOException e) {
if (socketChannel.isOpen()) { if (socketChannel.isOpen()) {
try { try {
LOGGER.debug("Connection failed from peer {} while connecting/closing", address);
socketChannel.close(); socketChannel.close();
} catch (IOException ce) { } catch (IOException ce) {
// Couldn't close? // Couldn't close?

Loading…
Cancel
Save