diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java index b8bc674fd8b8949a4e8b2bf55b10712309756779..e08bfeb1774d44a1c62722bcae0c9f4c14684005 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java @@ -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) {