forked from I2P_Developers/i2p.i2p
Compare commits
5 Commits
i2p.i2p.2.
...
i2p.i2p.2.
Author | SHA1 | Date | |
---|---|---|---|
b80505f3ae | |||
00e3390437 | |||
c67ff1376a | |||
2af65243a4 | |||
de2b122f7b |
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -702,7 +702,6 @@ public class IterativeSearchJob extends FloodSearchJob {
|
||||
// we will credit the wrong one.
|
||||
int tries;
|
||||
Hash peer = null;
|
||||
Destination dest = null;
|
||||
|
||||
synchronized(this) {
|
||||
if (_dead) return;
|
||||
@ -715,14 +714,6 @@ public class IterativeSearchJob extends FloodSearchJob {
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm success by checking for the Lease Set in local storage
|
||||
if (_isLease) {
|
||||
dest = getContext().netDb().lookupDestinationLocally(_key);
|
||||
if ((dest == null) && (_log.shouldLog(Log.WARN)))
|
||||
_log.warn("Warning! Lease Set not found in persistent data store for key = " + _key);
|
||||
}
|
||||
|
||||
|
||||
_facade.complete(_key);
|
||||
if (peer != null) {
|
||||
Long timeSent = _sentTime.get(peer);
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user