Compare commits

...

3 Commits

2 changed files with 13 additions and 8 deletions

View File

@ -252,13 +252,23 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
* @since 0.7.11
*/
boolean shouldThrottleLookup(Hash from, TunnelId id) {
if (isClientDb()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Lookup for:" + from + " sent to a client DB: "+_dbid.toString()+", bypassing throttle");
return false;
}
// null before startup
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
}
boolean shouldThrottleBurstLookup(Hash from, TunnelId id) {
if (isClientDb()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Lookup for:" + from + " sent to a client DB: "+_dbid.toString()+", bypassing throttle");
return false;
}
// null before startup
return _lookupThrottler == null || _lookupThrottlerBurst.shouldThrottle(from, id);
return _lookupThrottlerBurst == null || _lookupThrottlerBurst.shouldThrottle(from, id);
}
/**

View File

@ -44,7 +44,7 @@ class RepublishLeaseSetJob extends JobImpl {
try {
if (getContext().clientManager().isLocal(_dest)) {
LeaseSet ls = getContext().clientNetDb(_dest).lookupLeaseSetLocally(_dest);
LeaseSet ls = _facade.lookupLeaseSetLocally(_dest);
if (ls != null) {
if (!ls.isCurrent(Router.CLOCK_FUDGE_FACTOR)) {
if (_log.shouldLog(Log.WARN))
@ -101,12 +101,7 @@ class RepublishLeaseSetJob extends JobImpl {
public void runJob() {
// Don't requeue if there's a newer LS, KNDF will have already done that
LeaseSet ls = null;
if (_dest != null)
ls = getContext().clientNetDb(_dest).lookupLeaseSetLocally(_ls.getHash());
else
getContext().netDb().lookupLeaseSetLocally(_ls.getHash());
// ^ _dest should never be null here, right? So maybe instead we return immediately?
LeaseSet ls = _facade.lookupLeaseSetLocally(_ls.getHash());
if (ls != null && ls.getEarliestLeaseDate() == _ls.getEarliestLeaseDate()) {
requeueRepublish();
} else {