diff --git a/router/java/src/net/i2p/router/ClientTunnelSettings.java b/router/java/src/net/i2p/router/ClientTunnelSettings.java index cc8c74e6cc059c78e7b4ade8a640476c2bfe2fe1..efed48a9d71152102afd338c682991238e84684d 100644 --- a/router/java/src/net/i2p/router/ClientTunnelSettings.java +++ b/router/java/src/net/i2p/router/ClientTunnelSettings.java @@ -20,12 +20,8 @@ public class ClientTunnelSettings { private TunnelPoolSettings _outboundSettings; public ClientTunnelSettings() { - _inboundSettings = new TunnelPoolSettings(); - _inboundSettings.setIsInbound(true); - _inboundSettings.setIsExploratory(false); - _outboundSettings = new TunnelPoolSettings(); - _outboundSettings.setIsInbound(false); - _outboundSettings.setIsExploratory(false); + _inboundSettings = new TunnelPoolSettings(false, true); + _outboundSettings = new TunnelPoolSettings(false, false); } public TunnelPoolSettings getInboundSettings() { return _inboundSettings; } diff --git a/router/java/src/net/i2p/router/TunnelPoolSettings.java b/router/java/src/net/i2p/router/TunnelPoolSettings.java index 658e644f84cfe24543000aee2583af1f11ef6edf..ff8597882230acbddcd400ccbe27649413cbcbce 100644 --- a/router/java/src/net/i2p/router/TunnelPoolSettings.java +++ b/router/java/src/net/i2p/router/TunnelPoolSettings.java @@ -21,8 +21,8 @@ public class TunnelPoolSettings { private int _length; private int _lengthVariance; private int _lengthOverride; - private boolean _isInbound; - private boolean _isExploratory; + private final boolean _isInbound; + private final boolean _isExploratory; private boolean _allowZeroHop; private int _IPRestriction; private final Properties _unknownOptions; @@ -54,7 +54,9 @@ public class TunnelPoolSettings { public static final boolean DEFAULT_ALLOW_ZERO_HOP = true; public static final int DEFAULT_IP_RESTRICTION = 2; // class B (/16) - public TunnelPoolSettings() { + public TunnelPoolSettings(boolean isExploratory, boolean isInbound) { + _isExploratory = isExploratory; + _isInbound = isInbound; _quantity = DEFAULT_QUANTITY; _backupQuantity = DEFAULT_BACKUP_QUANTITY; // _rebuildPeriod = DEFAULT_REBUILD_PERIOD; @@ -130,11 +132,9 @@ public class TunnelPoolSettings { /** is this an inbound tunnel? */ public boolean isInbound() { return _isInbound; } - public void setIsInbound(boolean isInbound) { _isInbound = isInbound; } /** is this an exploratory tunnel (or a client tunnel) */ public boolean isExploratory() { return _isExploratory; } - public void setIsExploratory(boolean isExploratory) { _isExploratory = isExploratory; } // Duration is hardcoded //public int getDuration() { return _duration; } diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java index 42f7b189bd4ed9861de1b2ff2971adc9b6dfd11c..1b6c424eca69dfa9b61a9c8fa7c6e5b736013c99 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java @@ -64,13 +64,9 @@ public class TunnelPoolManager implements TunnelManagerFacade { _clientPeerSelector = new ClientPeerSelector(ctx); ExploratoryPeerSelector selector = new ExploratoryPeerSelector(_context); - TunnelPoolSettings inboundSettings = new TunnelPoolSettings(); - inboundSettings.setIsExploratory(true); - inboundSettings.setIsInbound(true); + TunnelPoolSettings inboundSettings = new TunnelPoolSettings(true, true); _inboundExploratory = new TunnelPool(_context, this, inboundSettings, selector); - TunnelPoolSettings outboundSettings = new TunnelPoolSettings(); - outboundSettings.setIsExploratory(true); - outboundSettings.setIsInbound(false); + TunnelPoolSettings outboundSettings = new TunnelPoolSettings(true, false); _outboundExploratory = new TunnelPool(_context, this, outboundSettings, selector); // threads will be started in startup()