Make the random port selection range match that of the I2P router

pull/53/head
Zlatin Balevsky 2020-05-08 17:37:06 +01:00
parent e1bf6c0821
commit 3b825263a7
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ public class Core {
&& i2pOptions.containsKey("i2np.udp.port")
)) {
Random r = new Random()
int port = r.nextInt(60000) + 4000
int port = 9151 + r.nextInt(1 + 30777 - 9151) // this range matches what the i2p router would choose
i2pOptions["i2np.ntcp.port"] = String.valueOf(port)
i2pOptions["i2np.udp.port"] = String.valueOf(port)
i2pOptionsFile.withOutputStream { i2pOptions.store(it, "") }