Skip to content

Commit

Permalink
Merge branch 'i2p.i2p.2.4.0-transient-client-subnetdbs' into 'master'
Browse files Browse the repository at this point in the history
Router: if a KNDF isClientDb() then set up a TransientDataStore instead of a PersistentDataStore

See merge request i2p-hackers/i2p.i2p!108
  • Loading branch information
eyedeekay committed Sep 18, 2023
2 parents b4c64e2 + d2b8d11 commit 9cad050
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ String getDbDir() {
String dbDir = _context.getProperty(PROP_DB_DIR, DEFAULT_DB_DIR);
if (!_dbid.equals(FloodfillNetworkDatabaseSegmentor.MAIN_DBID) && _dbid != null) {
File subDir = new File(dbDir, _dbid);
if (!subDir.exists())
subDir.mkdirs();
dbDir = subDir.toString();
}
return dbDir;
Expand All @@ -313,7 +311,11 @@ public synchronized void startup() {
BUCKET_SIZE, KAD_B, new RejectTrimmer<Hash>());
_dbDir = getDbDir();
try {
_ds = new PersistentDataStore(_context, _dbDir, this);
if (!isClientDb()) {
_ds = new PersistentDataStore(_context, _dbDir, this);
} else {
_ds = new TransientDataStore(_context);
}
} catch (IOException ioe) {
throw new RuntimeException("Unable to initialize netdb storage", ioe);
}
Expand Down

0 comments on commit 9cad050

Please sign in to comment.