forked from I2P_Developers/i2p.i2p
Router: eliminate useSubDbs option except for 2 comments in FNDS
This commit is contained in:
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -881,24 +881,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;
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user