diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java index 394c2db8862e41552836ae5c06269c34cf1830ea..2ad8163ae8aac67861be50dc3f3e24d2b78739ef 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java @@ -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); } }