From 4e6323453ca23d163a217bebfac15cd2d1d35519 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Mon, 4 Sep 2023 12:45:48 -0400 Subject: [PATCH] Router: change logging of floodfill subdb to main subdb in FNDS. Add TODO comments to getLocalClientsBlindData and lookupClientsBySigningPublicKey. --- .../FloodfillNetworkDatabaseSegmentor.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java index 3262d2ed4..73eba0e0a 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseSegmentor.java @@ -564,7 +564,7 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF } FloodfillNetworkDatabaseFacade fndb = _context.mainNetDb(); if (_log.shouldLog(Log.DEBUG)) - _log.debug("store " + key.toBase32() + " to floodfill"); + _log.debug("store " + key.toBase32() + " to main"); return fndb.store(key, leaseSet); } @@ -580,7 +580,7 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF } FloodfillNetworkDatabaseFacade fndb = _context.mainNetDb(); if (_log.shouldLog(Log.DEBUG)) - _log.debug("store " + key.toBase32() + " to floodfill"); + _log.debug("store " + key.toBase32() + " to main"); return fndb.store(key, routerInfo); } @@ -904,8 +904,11 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF public List getLocalClientsBlindData() { ArrayList rv = new ArrayList<>(); for (String subdb : _subDBs.keySet()) { - if (subdb.startsWith("clients_")) - ; + // if (subdb.startsWith("clients_")) + // TODO: see if we can access only one subDb at a time when we need + // to look up a client by SPK. We mostly need this for managing blinded + // and encrypted keys in the Keyring Config UI page. See also + // ConfigKeyringHelper rv.addAll(_subDBs.get(subdb).getBlindData()); } return rv; @@ -915,8 +918,11 @@ public class FloodfillNetworkDatabaseSegmentor extends SegmentedNetworkDatabaseF public List lookupClientBySigningPublicKey(SigningPublicKey spk) { List rv = new ArrayList<>(); for (String subdb : _subDBs.keySet()) { - if (subdb.startsWith("clients_")) - ; + // if (subdb.startsWith("clients_")) + // TODO: see if we can access only one subDb at a time when we need + // to look up a client by SPK. We mostly need this for managing blinded + // and encrypted keys in the Keyring Config UI page. See also + // ConfigKeyringHelper BlindData bd = _subDBs.get(subdb).getBlindData(spk); if (bd != null) { rv.add(subdb);