I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 132d76a0 authored by zzz's avatar zzz
Browse files

NetDB: SearchJob minor cleanup, only call getHash() once

parent c4b4b2d4
No related branches found
No related tags found
No related merge requests found
...@@ -479,12 +479,13 @@ class SearchJob extends JobImpl { ...@@ -479,12 +479,13 @@ class SearchJob extends JobImpl {
/** we're searching for a router, so we can just send direct */ /** we're searching for a router, so we can just send direct */
protected void sendRouterSearch(RouterInfo router) { protected void sendRouterSearch(RouterInfo router) {
int timeout = _facade.getPeerTimeout(router.getIdentity().getHash()); Hash to = router.getIdentity().getHash();
int timeout = _facade.getPeerTimeout(to);
long expiration = getContext().clock().now() + timeout; long expiration = getContext().clock().now() + timeout;
// use the 4-arg one so we pick up the override in ExploreJob // use the 4-arg one so we pick up the override in ExploreJob
//I2NPMessage msg = buildMessage(expiration); //I2NPMessage msg = buildMessage(expiration);
I2NPMessage msg = buildMessage(null, router.getIdentity().getHash(), expiration, router); I2NPMessage msg = buildMessage(null, to, expiration, router);
if (msg == null) { if (msg == null) {
if (_log.shouldWarn()) if (_log.shouldWarn())
_log.warn("Failed to create DLM to : " + router); _log.warn("Failed to create DLM to : " + router);
...@@ -493,11 +494,11 @@ class SearchJob extends JobImpl { ...@@ -493,11 +494,11 @@ class SearchJob extends JobImpl {
} }
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug(getJobId() + ": Sending router search directly to " + router.getIdentity().getHash() _log.debug(getJobId() + ": Sending router search directly to " + to
+ " for " + _state.getTarget()); + " for " + _state.getTarget());
SearchMessageSelector sel = new SearchMessageSelector(getContext(), router, _expiration, _state); SearchMessageSelector sel = new SearchMessageSelector(getContext(), router, _expiration, _state);
SearchUpdateReplyFoundJob reply = new SearchUpdateReplyFoundJob(getContext(), router, _state, _facade, this); SearchUpdateReplyFoundJob reply = new SearchUpdateReplyFoundJob(getContext(), router, _state, _facade, this);
SendMessageDirectJob j = new SendMessageDirectJob(getContext(), msg, router.getIdentity().getHash(), SendMessageDirectJob j = new SendMessageDirectJob(getContext(), msg, to,
reply, new FailedJob(getContext(), router), sel, timeout, reply, new FailedJob(getContext(), router), sel, timeout,
OutNetMessage.PRIORITY_EXPLORATORY); OutNetMessage.PRIORITY_EXPLORATORY);
if (FloodfillNetworkDatabaseFacade.isFloodfill(router)) if (FloodfillNetworkDatabaseFacade.isFloodfill(router))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment