i2ptunnel: Warn about soon-to-expire offline signatures

This commit is contained in:
zzz
2020-06-06 19:42:07 +00:00
parent 76493b398f
commit 220f641ba6

View File

@ -306,8 +306,14 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
I2PSession session = sockMgr.getSession();
if (session.isOffline()) {
long exp = session.getOfflineExpiration();
if (exp < getTunnel().getContext().clock().now())
long remaining = exp - getTunnel().getContext().clock().now();
if (remaining <= 0)
throw new IllegalArgumentException("Offline signature expired " + DataHelper.formatTime(exp));
if (remaining < 60*24*60*60*1000L) {
String msg = "Offline signature expires in " + DataHelper.formatDuration(remaining);
_log.logAlways(Log.WARN, msg);
l.log(msg);
}
}
while (session.isClosed()) {
try {