Skip to content

Commit

Permalink
Router: Remove some unused functions from SNDF and FNDS
Browse files Browse the repository at this point in the history
[
  • Loading branch information
eyedeekay committed Oct 29, 2023
1 parent 69e3d52 commit 03fe3fc
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ synchronized void setFloodfillEnabledFromMonitor(boolean yes) {
}

@Override
public boolean floodfillEnabled() {
if (isMultihomeDb())
return _context.netDb().floodfillEnabled();
public boolean floodfillEnabled() {
return _floodfillEnabled;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,33 +289,6 @@ public FloodfillNetworkDatabaseFacade clientNetDB(Hash id) {
return mainNetDB();
}

/**
* look up the dbid of the client or clients with the given signing
* public key
*
* @since 0.9.60
* @return non-null
*/
@Override
public List<Hash> lookupClientBySigningPublicKey(SigningPublicKey spk) {
List<Hash> rv = new ArrayList<>();
for (Hash subdb : _context.clientManager().getPrimaryHashes()) {
FloodfillNetworkDatabaseFacade fndf = _context.clientManager().getClientFloodfillNetworkDatabaseFacade(subdb);
if (fndf == null)
continue;
// 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 = fndf.getBlindData(spk);
if (bd != null) {
rv.add(subdb);
}
}
return rv;
}

/**
* get all the subDbs and return them in a Set. This includes the main netDb
* and the possible-multihomes netDb
Expand Down Expand Up @@ -357,19 +330,4 @@ private Set<FloodfillNetworkDatabaseFacade> getClientSubNetDBs() {
rv.addAll(_context.clientManager().getClientFloodfillNetworkDatabaseFacades());
return rv;
}

/**
* list of the BlindData objects for all known clients
*
* @since 0.9.60
* @return non-null
*/
@Override
public List<BlindData> getLocalClientsBlindData() {
List<BlindData> rv = new ArrayList<>();
for (FloodfillNetworkDatabaseFacade subdb : getClientSubNetDBs()) {
rv.addAll(subdb.getBlindData());
}
return rv;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,6 @@ public long getLastRouterInfoPublishTime() {
return _lastRIPublishTime;
}

public boolean matchClientKey(Hash key) {
if ((_localKey != null) && (_localKey.equals(key)))
return true;
else
return false;
}

/**
* Persist the local router's info (as updated) into netDb/my.info, since
* ./router.info isn't always updated. This also allows external applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ public Set<LeaseSet> getLeasesKnownToClients() {
* */
public ReseedChecker reseedChecker() {
return mainNetDB().reseedChecker();
};
/**
* For console ConfigKeyringHelper
*
* @return non-null
* @since 0.9.60
*/
public List<Hash> lookupClientBySigningPublicKey(SigningPublicKey spk) {
return Collections.emptyList();
}
/**
* For console ConfigKeyringHelper
Expand Down

0 comments on commit 03fe3fc

Please sign in to comment.