Transport: Don't record reachability changes in event log shortly after startup

This commit is contained in:
zzz
2021-03-02 09:15:58 -05:00
parent f04c0740c4
commit 4a9424b485
2 changed files with 4 additions and 2 deletions

View File

@@ -1534,9 +1534,10 @@ public class NTCPTransport extends TransportImpl {
if (_log.shouldLog(Log.WARN))
_log.warn("Old status: " + old + " New status: " + status +
" from: ", new Exception("traceback"));
if (old != Status.UNKNOWN)
if (old != Status.UNKNOWN && _context.router().getUptime() > 5*60*1000L) {
_context.router().eventLog().addEvent(EventLog.REACHABILITY,
"from " + _t(old.toStatusString()) + " to " + _t(status.toStatusString()));
}
}
_context.router().rebuildRouterInfo();
}

View File

@@ -3288,9 +3288,10 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_log.warn("Old status: " + old + " New status: " + status +
" Caused by update: " + newStatus +
" from: ", new Exception("traceback"));
if (old != Status.UNKNOWN)
if (old != Status.UNKNOWN && _context.router().getUptime() > 5*60*1000L) {
_context.router().eventLog().addEvent(EventLog.REACHABILITY,
"from " + _t(old.toStatusString()) + " to " + _t(status.toStatusString()));
}
// Always rebuild when the status changes, even if our address hasn't changed,
// as rebuildExternalAddress() calls replaceAddress() which calls CSFI.notifyReplaceAddress()
// which will start up NTCP inbound when we transition to OK.