diff --git a/router/java/src/net/i2p/router/client/ClientConnectionRunner.java b/router/java/src/net/i2p/router/client/ClientConnectionRunner.java index bdc67ce9d1a05126a861904144cfe8b8bcdc11d0..d3e551c537bbe210478760bfe85b71336b05b305 100644 --- a/router/java/src/net/i2p/router/client/ClientConnectionRunner.java +++ b/router/java/src/net/i2p/router/client/ClientConnectionRunner.java @@ -1185,8 +1185,6 @@ class ClientConnectionRunner { * @since 0.9.60 */ public FloodfillNetworkDatabaseFacade getFloodfillNetworkDatabaseFacade() { - if (!_context.netDbSegmentor().useSubDbs()) - return _context.netDb(); if (_log.shouldLog(Log.DEBUG)) _log.debug("getFloodfillNetworkDatabaseFacade is getting the subDb for dbid: " + this.getDestHash()); if (_floodfillNetworkDatabaseFacade == null) { diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java index 3d76316869a9a52fbfc4eaf1ec839fcc7c62c5b8..3d5c347868b2c2c05a9019250fa5855c815b2757 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java @@ -50,7 +50,7 @@ import net.i2p.util.Log; public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseFacade { protected final Log _log; private RouterContext _context; - private static final String PROP_NETDB_ISOLATION = "router.netdb.isolation"; + //private static final String PROP_NETDB_ISOLATION = "router.netdb.isolation"; public static final Hash MAIN_DBID = null; private final FloodfillNetworkDatabaseFacade _mainDbid; @@ -69,9 +69,10 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF _mainDbid = new FloodfillNetworkDatabaseFacade(_context, MAIN_DBID); } + /* Commented out prior to 2.4.0 release, might be worth resurrecting at some point public boolean useSubDbs() { return _context.getProperty(PROP_NETDB_ISOLATION, true); - } + }*/ /** * Retrieves the FloodfillNetworkDatabaseFacade object for the specified ID. @@ -82,8 +83,6 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF */ @Override protected FloodfillNetworkDatabaseFacade getSubNetDB(Hash id) { - if (!useSubDbs()) - return _mainDbid; return _context.clientManager().getClientFloodfillNetworkDatabaseFacade(id); } @@ -259,8 +258,6 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF public FloodfillNetworkDatabaseFacade clientNetDB(Hash id) { if (_log.shouldDebug()) _log.debug("looked up clientNetDB: " + id); - if (!useSubDbs()) - return _mainDbid; if (id != null){ FloodfillNetworkDatabaseFacade fndf = getSubNetDB(id); if (fndf != null) @@ -308,10 +305,6 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF if (!_mainDbid.isInitialized()) return Collections.emptySet(); Set<FloodfillNetworkDatabaseFacade> rv = new HashSet<>(); - if (!useSubDbs()) { - rv.add(_mainDbid); - return rv; - } rv.add(_mainDbid); rv.addAll(_context.clientManager().getClientFloodfillNetworkDatabaseFacades()); return rv; @@ -329,10 +322,6 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF if (!_mainDbid.isInitialized()) return Collections.emptySet(); Set<FloodfillNetworkDatabaseFacade> rv = new HashSet<>(); - if (!useSubDbs()) { - rv.add(_mainDbid); - return rv; - } rv.addAll(_context.clientManager().getClientFloodfillNetworkDatabaseFacades()); return rv; } @@ -347,7 +336,6 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF public List<BlindData> getLocalClientsBlindData() { List<BlindData> rv = new ArrayList<>(); for (FloodfillNetworkDatabaseFacade subdb : getClientSubNetDBs()) { - rv.addAll(subdb.getBlindData()); } return rv; } 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 cc5bc77ca25df9a2468e8f2bdb79c69bf5c11574..354b4266005a1bf48e89a19269188e0f15fde012 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -866,24 +866,22 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad _log.error("locally published leaseSet is not valid?", iae); throw iae; } - if (!_context.netDbSegmentor().useSubDbs()){ - String dbid = "main netDb"; - if (isClientDb()) { - dbid = "client netDb: " + _dbid; - } - if (_localKey != null) { - if (!_localKey.equals(localLeaseSet.getHash())) - if (_log.shouldLog(Log.ERROR)) - _log.error("[" + dbid + "]" + "Error, the local LS hash (" - + _localKey + ") does not match the published hash (" - + localLeaseSet.getHash() + ")! This shouldn't happen!", - new Exception()); - } else { - // This will only happen once when the local LS is first published - _localKey = localLeaseSet.getHash(); - if (_log.shouldLog(Log.INFO)) - _log.info("[" + dbid + "]" + "Local client LS key initialized to: " + _localKey); - } + String dbid = "main netDb"; + if (isClientDb()) { + dbid = "client netDb: " + _dbid; + } + if (_localKey != null) { + if (!_localKey.equals(localLeaseSet.getHash())) + if (_log.shouldLog(Log.ERROR)) + _log.error("[" + dbid + "]" + "Error, the local LS hash (" + + _localKey + ") does not match the published hash (" + + localLeaseSet.getHash() + ")! This shouldn't happen!", + new Exception()); + } else { + // This will only happen once when the local LS is first published + _localKey = localLeaseSet.getHash(); + if (_log.shouldLog(Log.INFO)) + _log.info("[" + dbid + "]" + "Local client LS key initialized to: " + _localKey); } if (!_context.clientManager().shouldPublishLeaseSet(h)) return; diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/SegmentedNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/SegmentedNetworkDatabaseFacade.java index 3f61a9ba743d210a65eba7527051b9f7ac8bf724..b7a4b9735a4662b372c616071d0caf750267bea5 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/SegmentedNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/SegmentedNetworkDatabaseFacade.java @@ -60,16 +60,6 @@ public abstract class SegmentedNetworkDatabaseFacade { public SegmentedNetworkDatabaseFacade(RouterContext context) { // super(context, null); } - - /** - * Determine whether to use subDb defenses at all or to use the extant FNDF/RAP/RAR defenses - * - * @return true if using subDbs, false if not - * @since 0.9.60 - */ - public boolean useSubDbs() { - return false; - } /** * Get a sub-netDb using a Hash identifier