SSU2: Enable by default

This commit is contained in:
zzz
2022-09-28 09:26:28 -04:00
parent 0eb96d6ef0
commit 64873218ba
3 changed files with 7 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 10;
public final static long BUILD = 11;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -84,11 +84,10 @@ public class TransportManager implements TransportEventListener {
/** default true */
public final static String PROP_ENABLE_UDP = "i2np.udp.enable";
/**
* Default true as of 0.9.56
* @since 0.9.54
*/
public final static String PROP_ENABLE_SSU2 = "i2np.ssu2.enable";
/** 1 in this many */
private static final int SSU2_ENABLE_PROBABILITY = 50;
/** default true */
public final static String PROP_ENABLE_NTCP = "i2np.ntcp.enable";
/** default true */
@@ -261,17 +260,7 @@ public class TransportManager implements TransportEventListener {
private void configTransports() {
Transport udp = null;
if (_enableUDP) {
String ssu2 = _context.getProperty(PROP_ENABLE_SSU2);
boolean enableSSU2 = false;
if (ssu2 == null) {
// Migration, to be removed when we change to default true
if (SystemVersion.isSlow() || _context.random().nextInt(SSU2_ENABLE_PROBABILITY) == 0) {
enableSSU2 = true;
_context.router().saveConfig(PROP_ENABLE_SSU2, "true");
}
} else {
enableSSU2 = Boolean.parseBoolean(ssu2);
}
boolean enableSSU2 = _context.getBooleanPropertyDefaultTrue(PROP_ENABLE_SSU2);
X25519KeyFactory xdh = enableSSU2 ? _xdhThread : null;
udp = new UDPTransport(_context, _dhThread, xdh);
addTransport(udp);