I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7c928f99 authored by zzz's avatar zzz
Browse files

Router: Only flood LS2 to router that supports it

Use same version check in StoreJob for flooding
parent 9efa0eaa
No related branches found
No related tags found
No related merge requests found
......@@ -234,6 +234,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
_log.info("Flooding the entry for " + key + " to " + i + " more, just before midnight");
}
int flooded = 0;
boolean isls2 = ds.isLeaseSet() && ds.getType() != DatabaseEntry.KEY_TYPE_LEASESET;
for (int i = 0; i < peers.size(); i++) {
Hash peer = peers.get(i);
RouterInfo target = lookupRouterInfoLocally(peer);
......@@ -246,6 +247,11 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
continue;
if (peer.equals(_context.routerHash()))
continue;
// min version checks
if (isls2 && !StoreJob.shouldStoreLS2To(target))
continue;
if (!StoreJob.shouldStoreTo(target))
continue;
DatabaseStoreMessage msg = new DatabaseStoreMessage(_context);
msg.setEntry(ds);
OutNetMessage m = new OutNetMessage(_context, msg, _context.clock().now()+FLOOD_TIMEOUT, FLOOD_PRIORITY, target);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment