diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java index 3e0bc0e323..cffc1f16a9 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java @@ -126,7 +126,7 @@ public synchronized void startup() { @Override protected void createHandlers() { // Only initialize the handlers for the flooodfill netDb. - if (super._dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID) { + if (!isClientDb()) { if (_log.shouldInfo()) _log.info("[dbid: " + super._dbid + "] Initializing the message handlers"); _context.inNetMessagePool().registerHandlerJobBuilder(DatabaseLookupMessage.MESSAGE_TYPE, new FloodfillDatabaseLookupMessageHandler(_context, this)); diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java index cefcb37f55..3726eed81d 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -307,6 +307,8 @@ String getDbDir() { } public boolean isClientDb() { + // This is a null check in disguise, don't use .equals() here. + // FNDS.MAIN_DBID is always null. and if _dbid is also null it is not a client Db if (_dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID) return false; if (_dbid.equals(FloodfillNetworkDatabaseSegmentor.MULTIHOME_DBID)) @@ -315,6 +317,8 @@ public boolean isClientDb() { } public boolean isMultihomeDb() { + // This is a null check in disguise, don't use .equals() here. + // FNDS.MAIN_DBID is always null, and if _dbid is null it is not the multihome Db if (_dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID) return false; if (_dbid.equals(FloodfillNetworkDatabaseSegmentor.MULTIHOME_DBID))