Router: Restart fixes part 2

Don't set our RI loaded from disk if too old
Rekeying was prevented by previous checkin,
but this fixes root cause
This commit is contained in:
zzz
2022-04-14 08:25:16 -04:00
parent 04b1bdb453
commit dda25bf1ed
3 changed files with 29 additions and 1 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 = 13;
public final static long BUILD = 14;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -131,6 +131,17 @@ class LoadRouterInfoJob extends JobImpl {
fis1 = null;
rif.delete();
}
if (_us != null) {
long now = getContext().clock().now();
long riTime = _us.getPublished();
if (riTime > now || now - riTime > 45*60*1000) {
// prevent netdb store failure and rekey
_us = null;
try { fis1.close(); } catch (IOException ioe2) {}
fis1 = null;
rif.delete();
}
}
}
if (keys2Exist || keysExist) {