From eb4e95544c830426cb726928a7223df972131748 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Thu, 12 Oct 2023 15:31:34 -0400 Subject: [PATCH] Router: remove useless check from ClientManager. Use main netDb if the runner performing a lookup has a null destHash. --- router/java/src/net/i2p/router/client/ClientManager.java | 5 ----- router/java/src/net/i2p/router/client/LookupDestJob.java | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/router/java/src/net/i2p/router/client/ClientManager.java b/router/java/src/net/i2p/router/client/ClientManager.java index a0bd6d16cc..c9c77bb46a 100644 --- a/router/java/src/net/i2p/router/client/ClientManager.java +++ b/router/java/src/net/i2p/router/client/ClientManager.java @@ -785,11 +785,6 @@ public FloodfillNetworkDatabaseFacade getClientFloodfillNetworkDatabaseFacade(Ha if (_log.shouldLog(Log.DEBUG)) _log.debug("Getting subDb for desthash: " + destHash); ClientConnectionRunner runner = getRunner(destHash); - if (runner == null){ - if (_log.shouldLog(Log.WARN)) - _log.warn("ClientManager got a null runner in getClientFloodfillNetworkDatabaseFacade for " + destHash); - return null; - } if (_log.shouldLog(Log.DEBUG)) _log.debug("ClientManager got a runner in getClientFloodfillNetworkDatabaseFacade for " + destHash); return runner.getFloodfillNetworkDatabaseFacade(); diff --git a/router/java/src/net/i2p/router/client/LookupDestJob.java b/router/java/src/net/i2p/router/client/LookupDestJob.java index 9824aa5268..4eb957515a 100644 --- a/router/java/src/net/i2p/router/client/LookupDestJob.java +++ b/router/java/src/net/i2p/router/client/LookupDestJob.java @@ -274,6 +274,11 @@ else if (_hash != null) * @return */ private FloodfillNetworkDatabaseFacade getRequiredFloodfillNetworkDatabaseFacade() { + if (_runner.getDestHash() == null) { + if (_log.shouldLog(Log.DEBUG)) + _log.debug("destHash is null in runner in lookup for " + _hash + " using the main DB instead"); + return getContext().netDb(); + } FloodfillNetworkDatabaseFacade fndf = _runner.getFloodfillNetworkDatabaseFacade(); if (fndf == null){ fndf = getContext().netDb();