Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p

This commit is contained in:
eyedeekay
2024-08-25 23:21:10 -04:00
2 changed files with 8 additions and 2 deletions

View File

@@ -544,7 +544,12 @@ public class LeaseSet2 extends LeaseSet {
long pub1k = _published / 1000;
DataHelper.writeLong(out, 4, pub1k);
// Divide separately to prevent rounding errors
DataHelper.writeLong(out, 2, ((_expires / 1000) - pub1k));
long exp = (_expires / 1000) - pub1k;
// writeLong() will throw if we try to write a negative, so preempt it with a better message
// This will only happen on the client side for leasesets we create.
if (exp < 0)
throw new DataFormatException("Leaseset expired " + (0 - exp) + " seconds ago");
DataHelper.writeLong(out, 2, exp);
DataHelper.writeLong(out, 2, _flags);
if (isOffline())
writeOfflineBytes(out);

View File

@@ -770,7 +770,8 @@ public class TunnelPool {
return null;
}
long expireAfter = _context.clock().now(); // + _settings.getRebuildPeriod();
// we don't want it to expire before the client signs it or the ff gets it
long expireAfter = _context.clock().now() - 10*1000;
TunnelInfo zeroHopTunnel = null;
Lease zeroHopLease = null;