NetDB: Call fail callback when lookup is negative cached (thx zab)

This commit is contained in:
zzz
2019-03-04 17:07:45 +00:00
parent cd97718682
commit 5d3b7c1c53

View File

@ -597,6 +597,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
} else if (isNegativeCached(key)) {
if (_log.shouldInfo())
_log.info("Negative cached, not searching dest: " + key);
_context.jobQueue().addJob(onFinishedJob);
} else {
search(key, onFinishedJob, onFinishedJob, timeoutMs, true, fromLocalDest);
}
@ -634,6 +635,8 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
} else if (isNegativeCached(key)) {
if (_log.shouldInfo())
_log.info("Negative cached, not searching RI: " + key);
if (onFailedLookupJob != null)
_context.jobQueue().addJob(onFailedLookupJob);
} else {
search(key, onFindJob, onFailedLookupJob, timeoutMs, false);
}