Router: remove the redundant casts, fixes #438

This commit is contained in:
eyedeekay
2023-10-09 14:53:52 -04:00
parent 4c7846be2c
commit dec98e6b8d
4 changed files with 4 additions and 4 deletions
@@ -691,7 +691,7 @@ class InboundEstablishState extends EstablishBase implements NTCP2Payload.Payloa
try {
RouterInfo old = _context.netDb().store(h, ri);
if (flood && !ri.equals(old)) {
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
FloodfillNetworkDatabaseFacade fndf = _context.netDb();
if (fndf.floodConditional(ri)) {
if (_log.shouldDebug())
_log.debug("Flooded the RI: " + h);
@@ -1670,7 +1670,7 @@ public class NTCPConnection implements Closeable {
return;
RouterInfo old = _context.netDb().store(h, ri);
if (flood && !ri.equals(old)) {
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
FloodfillNetworkDatabaseFacade fndf = _context.netDb();
if ((old == null || ri.getPublished() > old.getPublished()) &&
fndf.floodConditional(ri)) {
if (_log.shouldDebug())
@@ -376,7 +376,7 @@ class InboundEstablishState2 extends InboundEstablishState implements SSU2Payloa
try {
RouterInfo old = _context.netDb().store(h, ri);
if (flood && !ri.equals(old)) {
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
FloodfillNetworkDatabaseFacade fndf = _context.netDb();
if (fndf.floodConditional(ri)) {
if (_log.shouldDebug())
_log.debug("Flooded the RI: " + h);
@@ -634,7 +634,7 @@ public class PeerState2 extends PeerState implements SSU2Payload.PayloadCallback
return;
RouterInfo old = _context.netDb().store(h, ri);
if (flood && !ri.equals(old)) {
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
FloodfillNetworkDatabaseFacade fndf = _context.netDb();
if ((old == null || ri.getPublished() > old.getPublished()) &&
fndf.floodConditional(ri)) {
if (_log.shouldDebug())