forked from I2P_Developers/i2p.i2p
NTCP2: New FNDF method
This commit is contained in:
@ -180,6 +180,24 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
|||||||
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
|
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If we are floodfill AND the key is not throttled,
|
||||||
|
* flood it, otherwise don't.
|
||||||
|
*
|
||||||
|
* @return if we did
|
||||||
|
* @since 0.9.36 for NTCP2
|
||||||
|
*/
|
||||||
|
public boolean floodConditional(DatabaseEntry ds) {
|
||||||
|
if (!floodfillEnabled())
|
||||||
|
return false;
|
||||||
|
if (shouldThrottleFlood(ds.getHash())) {
|
||||||
|
_context.statManager().addRateData("netDb.floodThrottled", 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
flood(ds);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send to a subset of all floodfill peers.
|
* Send to a subset of all floodfill peers.
|
||||||
* We do this to implement Kademlia within the floodfills, i.e.
|
* We do this to implement Kademlia within the floodfills, i.e.
|
||||||
|
Reference in New Issue
Block a user