Skip to content

Commit d2b8d11

Browse files
author
eyedeekay
committed
Router: if a KNDF isClientDb() then set up a TransientDataStore instead of a PersistentDataStore
1 parent b4c64e2 commit d2b8d11

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ String getDbDir() {
293293
String dbDir = _context.getProperty(PROP_DB_DIR, DEFAULT_DB_DIR);
294294
if (!_dbid.equals(FloodfillNetworkDatabaseSegmentor.MAIN_DBID) && _dbid != null) {
295295
File subDir = new File(dbDir, _dbid);
296-
if (!subDir.exists())
297-
subDir.mkdirs();
298296
dbDir = subDir.toString();
299297
}
300298
return dbDir;
@@ -313,7 +311,11 @@ public synchronized void startup() {
313311
BUCKET_SIZE, KAD_B, new RejectTrimmer<Hash>());
314312
_dbDir = getDbDir();
315313
try {
316-
_ds = new PersistentDataStore(_context, _dbDir, this);
314+
if (!isClientDb()) {
315+
_ds = new PersistentDataStore(_context, _dbDir, this);
316+
} else {
317+
_ds = new TransientDataStore(_context);
318+
}
317319
} catch (IOException ioe) {
318320
throw new RuntimeException("Unable to initialize netdb storage", ioe);
319321
}

0 commit comments

Comments
 (0)