forked from I2P_Developers/i2p.i2p
NTCP2: Reduce min downtime for rekeying if hidden
This commit is contained in:
@ -137,6 +137,7 @@ public class NTCPTransport extends TransportImpl {
|
||||
private static final int NTCP2_IV_LEN = OutboundNTCP2State.IV_SIZE;
|
||||
private static final int NTCP2_KEY_LEN = OutboundNTCP2State.KEY_SIZE;
|
||||
private static final long MIN_DOWNTIME_TO_REKEY = 30*24*60*60*1000L;
|
||||
private static final long MIN_DOWNTIME_TO_REKEY_HIDDEN = 24*60*60*1000L;
|
||||
private final boolean _enableNTCP1;
|
||||
private final boolean _enableNTCP2;
|
||||
private final byte[] _ntcp2StaticPubkey;
|
||||
@ -252,7 +253,8 @@ public class NTCPTransport extends TransportImpl {
|
||||
String b64IV = null;
|
||||
String s = null;
|
||||
// try to determine if we've been down for 30 days or more
|
||||
boolean shouldRekey = _context.getEstimatedDowntime() >= MIN_DOWNTIME_TO_REKEY;
|
||||
long minDowntime = _context.router().isHidden() ? MIN_DOWNTIME_TO_REKEY_HIDDEN : MIN_DOWNTIME_TO_REKEY;
|
||||
boolean shouldRekey = _context.getEstimatedDowntime() >= minDowntime;
|
||||
if (!shouldRekey) {
|
||||
s = ctx.getProperty(PROP_NTCP2_SP);
|
||||
if (s != null) {
|
||||
|
Reference in New Issue
Block a user