From d2b8d11645c0fcb99091c996847c94009d57bad9 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Fri, 15 Sep 2023 12:14:38 -0400 Subject: [PATCH] Router: if a KNDF isClientDb() then set up a TransientDataStore instead of a PersistentDataStore --- .../networkdb/kademlia/KademliaNetworkDatabaseFacade.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 9e75d5a25c..825eaa67e8 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -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; @@ -313,7 +311,11 @@ public synchronized void startup() { BUCKET_SIZE, KAD_B, new RejectTrimmer()); _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); }