NTCP: Log source of clock adjustment at startup

This commit is contained in:
zzz
2022-12-14 14:58:44 -05:00
parent f50f55bb54
commit 9d50e4d5ed
2 changed files with 4 additions and 2 deletions

View File

@@ -211,7 +211,8 @@ class InboundEstablishState extends EstablishBase implements NTCP2Payload.Payloa
_context.clock().setOffset(1000 * (0 - _peerSkew), true);
_peerSkew = 0;
if (diff != 0)
_log.logAlways(Log.WARN, "NTP failure, NTCP adjusting clock by " + DataHelper.formatDuration(diff));
_log.logAlways(Log.WARN, "NTP failure, NTCP adjusting clock by " + DataHelper.formatDuration(diff) +
" source router: " + aliceHash);
} else if (diff >= Router.CLOCK_FUDGE_FACTOR) {
// Only banlist if we know what time it is
_context.banlist().banlistRouter(DataHelper.formatDuration(diff),

View File

@@ -319,7 +319,8 @@ class OutboundNTCP2State implements EstablishState {
// We are Alice, he is Bob, adjust to match Bob
_context.clock().setOffset(1000 * (0 - _peerSkew), true);
_peerSkew = 0;
_log.logAlways(Log.WARN, "NTP failure, NTCP adjusting clock by " + DataHelper.formatDuration(diff));
_log.logAlways(Log.WARN, "NTP failure, NTCP adjusting clock by " + DataHelper.formatDuration(diff) +
" source router: " + _con.getRemotePeer().calculateHash());
}
changeState(State.OB_GOT_HXY);
_received = 0;