Skip to content

Commit

Permalink
Router: Comment isClientDb() and isMultihomeDb() checks in KNDF so th…
Browse files Browse the repository at this point in the history
…ey're less confusing to look at
  • Loading branch information
eyedeekay committed Oct 6, 2023
1 parent c646099 commit daa2ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public synchronized void startup() {
@Override
protected void createHandlers() {
// Only initialize the handlers for the flooodfill netDb.
if (super._dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID) {
if (!isClientDb()) {
if (_log.shouldInfo())
_log.info("[dbid: " + super._dbid + "] Initializing the message handlers");
_context.inNetMessagePool().registerHandlerJobBuilder(DatabaseLookupMessage.MESSAGE_TYPE, new FloodfillDatabaseLookupMessageHandler(_context, this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ String getDbDir() {
}

public boolean isClientDb() {
// This is a null check in disguise, don't use .equals() here.
// FNDS.MAIN_DBID is always null. and if _dbid is also null it is not a client Db
if (_dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID)
return false;
if (_dbid.equals(FloodfillNetworkDatabaseSegmentor.MULTIHOME_DBID))
Expand All @@ -315,6 +317,8 @@ public boolean isClientDb() {
}

public boolean isMultihomeDb() {
// This is a null check in disguise, don't use .equals() here.
// FNDS.MAIN_DBID is always null, and if _dbid is null it is not the multihome Db
if (_dbid == FloodfillNetworkDatabaseSegmentor.MAIN_DBID)
return false;
if (_dbid.equals(FloodfillNetworkDatabaseSegmentor.MULTIHOME_DBID))
Expand Down

0 comments on commit daa2ae1

Please sign in to comment.