Changeset 0f048a7


Ignore:
Timestamp:
Jun 26, 2018 3:39:08 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
55a8878a
Parents:
435bf819
Message:

NTCP2: New FNDF method

File:
1 edited

Legend:

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

    r435bf819 r0f048a7  
    179179        // null before startup
    180180        return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
     181    }
     182
     183    /**
     184     *  If we are floodfill AND the key is not throttled,
     185     *  flood it, otherwise don't.
     186     *
     187     *  @return if we did
     188     *  @since 0.9.36 for NTCP2
     189     */
     190    public boolean floodConditional(DatabaseEntry ds) {
     191        if (!floodfillEnabled())
     192            return false;
     193        if (shouldThrottleFlood(ds.getHash())) {
     194            _context.statManager().addRateData("netDb.floodThrottled", 1);
     195            return false;
     196        }
     197        flood(ds);
     198        return true;
    181199    }
    182200
Note: See TracChangeset for help on using the changeset viewer.