diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/BlindCache.java b/router/java/src/net/i2p/router/networkdb/kademlia/BlindCache.java index 2a34bead6a..9cb55324d7 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/BlindCache.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/BlindCache.java @@ -43,7 +43,7 @@ class BlindCache { private final ConcurrentHashMap _hashCache; private boolean _changed; - private static final String PERSIST_FILE = "router.blindcache.dat"; + private final String PERSIST_FILE; /** * Caller MUST call startup() to load persistent cache from disk @@ -53,6 +53,21 @@ public BlindCache(RouterContext ctx) { _cache = new ConcurrentHashMap(32); _reverseCache = new ConcurrentHashMap(32); _hashCache = new ConcurrentHashMap(32); + PERSIST_FILE = "router.blindcache.dat"; + } + + /** + * Caller MUST call startup() to load persistent cache from disk + */ + public BlindCache(RouterContext ctx, Hash subDb) { + _context = ctx; + _cache = new ConcurrentHashMap(32); + _reverseCache = new ConcurrentHashMap(32); + _hashCache = new ConcurrentHashMap(32); + if (subDb == null) + PERSIST_FILE = "router." + subDb.toString() + ".blindcache.dat"; + else + PERSIST_FILE = "router.blindcache.dat"; } /** 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 b7da715250..040434cfe1 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -184,7 +184,7 @@ public KademliaNetworkDatabaseFacade(RouterContext context, Hash dbid) { _reseedChecker = null; else _reseedChecker = new ReseedChecker(context); - _blindCache = new BlindCache(context); + _blindCache = new BlindCache(context, dbid); _localKey = null; if (_log.shouldLog(Log.DEBUG))