Router: change logging of floodfill subdb to main subdb in FNDS. Add TODO comments to getLocalClientsBlindData and lookupClientsBySigningPublicKey.

This commit is contained in:
eyedeekay
2023-09-04 12:45:48 -04:00
parent 76067312e1
commit 4e6323453c

View File

@@ -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<BlindData> getLocalClientsBlindData() {
ArrayList<BlindData> 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<String> lookupClientBySigningPublicKey(SigningPublicKey spk) {
List<String> 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);