Changeset 399899e7


Ignore:
Timestamp:
Dec 8, 2018 6:24:14 PM (16 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c1850cc
Parents:
bdc4d82e
Message:

NetDb?: Allow longer expiration for Meta LS2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    rbdc4d82e r399899e7  
    137137    private final static long ROUTER_INFO_EXPIRATION_INTRODUCED = 45*60*1000l;
    138138   
     139    /**
     140     * Don't let leaseSets go too far into the future
     141     */
     142    private static final long MAX_LEASE_FUTURE = 15*60*1000;
     143    private static final long MAX_META_LEASE_FUTURE = 65535*1000;
     144   
    139145    private final static long EXPLORE_JOB_DELAY = 10*60*1000l;
    140146
     
    773779   
    774780    /**
    775      * Don't let leaseSets go 20 minutes into the future
    776      */
    777     static final long MAX_LEASE_FUTURE = 20*60*1000;
    778    
    779     /**
    780781     * Determine whether this leaseSet will be accepted as valid and current
    781782     * given what we know now.
     
    819820                   + " expired " + DataHelper.formatDuration(age) + " ago";
    820821        }
    821         if (latest > now + (Router.CLOCK_FUDGE_FACTOR + MAX_LEASE_FUTURE)) {
     822        if (latest > now + (Router.CLOCK_FUDGE_FACTOR + MAX_LEASE_FUTURE) &&
     823            (leaseSet.getType() != DatabaseEntry.KEY_TYPE_META_LS2 ||
     824             latest > now + (Router.CLOCK_FUDGE_FACTOR + MAX_META_LEASE_FUTURE))) {
    822825            long age = latest - now;
    823826            // let's not make this an error, it happens when peers have bad clocks
Note: See TracChangeset for help on using the changeset viewer.