Skip to content

Commit

Permalink
Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Aug 26, 2024
2 parents aa4e6e1 + 8ff4797 commit 8955397
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/java/src/net/i2p/data/LeaseSet2.java
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,12 @@ protected void writeHeader(OutputStream out) throws DataFormatException, IOExcep
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);
Expand Down
3 changes: 2 additions & 1 deletion router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,8 @@ protected LeaseSet locked_buildNewLeaseSet() {
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;
Expand Down

0 comments on commit 8955397

Please sign in to comment.