I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 1f81d354 authored by zzz's avatar zzz
Browse files

Router: Tighten skew calculation window

parent 12239124
No related branches found
No related tags found
No related merge requests found
......@@ -170,7 +170,7 @@ public class RouterInfoHandler implements RequestHandler {
&& (!_context.router().gracefulShutdownInProgress())
&& !_context.clientManager().isAlive())
return (NETWORK_STATUS.ERROR_I2CP);
long skew = _context.commSystem().getFramedAveragePeerClockSkew(33);
long skew = _context.commSystem().getFramedAveragePeerClockSkew(10);
// Display the actual skew, not the offset
if (Math.abs(skew) > 60 * 1000)
return NETWORK_STATUS.ERROR_CLOCK_SKEW;
......
......@@ -234,7 +234,7 @@ public class SummaryHelper extends HelperBase {
// Warn based on actual skew from peers, not update status, so if we successfully offset
// the clock, we don't complain.
//if (!_context.clock().getUpdatedSuccessfully())
long skew = _context.commSystem().getFramedAveragePeerClockSkew(33);
long skew = _context.commSystem().getFramedAveragePeerClockSkew(10);
// Display the actual skew, not the offset
if (Math.abs(skew) > 30*1000)
return new NetworkStateMessage(NetworkState.CLOCKSKEW, fixup(_t("ERR-Clock Skew of {0}", DataHelper.formatDuration2(Math.abs(skew)))));
......
......@@ -155,7 +155,7 @@ public class RouterClock extends Clock {
// This may get called very early at startup, before RouterContext.initAll() is completed,
// so the comm system may be null. Avoid NPE.
CommSystemFacade csf = ((RouterContext)_context).commSystem();
long currentPeerClockSkew = (csf != null) ? csf.getFramedAveragePeerClockSkew(33) : 0;
long currentPeerClockSkew = (csf != null) ? csf.getFramedAveragePeerClockSkew(10) : 0;
// Predict the effect of applying the proposed clock offset
long predictedPeerClockSkew = currentPeerClockSkew + delta;
......
......@@ -682,7 +682,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
public void timeReached() {
// use the same % as in RouterClock so that check will never fail
// This is their our offset w.r.t. them...
long peerOffset = getFramedAveragePeerClockSkew(33);
long peerOffset = getFramedAveragePeerClockSkew(10);
if (peerOffset == 0)
return;
long currentOffset = _context.clock().getOffset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment