forked from I2P_Developers/i2p.i2p
NTCP: Don't flood RI block unless newer
Don't accept store of our RI in RI block
This commit is contained in:
@@ -1641,10 +1641,13 @@ public class NTCPConnection implements Closeable {
|
||||
_messagesRead.incrementAndGet();
|
||||
try {
|
||||
Hash h = ri.getHash();
|
||||
if (h.equals(_context.routerHash()))
|
||||
return;
|
||||
RouterInfo old = _context.netDb().store(h, ri);
|
||||
if (flood && !ri.equals(old)) {
|
||||
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
|
||||
if (fndf.floodConditional(ri)) {
|
||||
if ((old == null || ri.getPublished() > old.getPublished()) &&
|
||||
fndf.floodConditional(ri)) {
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("Flooded the RI: " + h);
|
||||
} else {
|
||||
@@ -1653,7 +1656,8 @@ public class NTCPConnection implements Closeable {
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException iae) {
|
||||
throw new DataFormatException("RI store fail: " + ri, iae);
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("RI store fail: " + ri, iae);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user