forked from I2P_Developers/i2p.i2p
* DataStructures:
- Remove static logs
- Sort addresses in RouterInfo at initialization only;
change from Set to List to save space
- Remove unused counters in Lease to save space
- Increase max leases to 16
This commit is contained in:
@@ -479,15 +479,9 @@ public class Blocklist {
|
||||
List<byte[]> rv = new ArrayList(1);
|
||||
RouterInfo pinfo = _context.netDb().lookupRouterInfoLocally(peer);
|
||||
if (pinfo == null) return rv;
|
||||
Set<RouterAddress> paddr = pinfo.getAddresses();
|
||||
if (paddr == null || paddr.isEmpty())
|
||||
return rv;
|
||||
String oldphost = null;
|
||||
List<RouterAddress> pladdr = new ArrayList(paddr);
|
||||
// for each peer address
|
||||
for (int j = 0; j < paddr.size(); j++) {
|
||||
RouterAddress pa = (RouterAddress) pladdr.get(j);
|
||||
if (pa == null) continue;
|
||||
for (RouterAddress pa : pinfo.getAddresses()) {
|
||||
String phost = pa.getOption("host");
|
||||
if (phost == null) continue;
|
||||
if (oldphost != null && oldphost.equals(phost)) continue;
|
||||
|
||||
@@ -216,7 +216,7 @@ public class FloodfillVerifyStoreJob extends JobImpl {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Verify failed (older) for " + _key);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Rcvd older lease: " + dsm.getEntry());
|
||||
_log.info("Rcvd older data: " + dsm.getEntry());
|
||||
} else if (_message instanceof DatabaseSearchReplyMessage) {
|
||||
// assume 0 old, all new, 0 invalid, 0 dup
|
||||
getContext().profileManager().dbLookupReply(_target, 0,
|
||||
|
||||
@@ -8,12 +8,13 @@ package net.i2p.router.networkdb.kademlia;
|
||||
*
|
||||
*/
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.data.DatabaseEntry;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.LeaseSet;
|
||||
import net.i2p.data.RouterAddress;
|
||||
import net.i2p.data.RouterIdentity;
|
||||
import net.i2p.data.RouterInfo;
|
||||
import net.i2p.data.i2np.DatabaseStoreMessage;
|
||||
@@ -145,9 +146,9 @@ public class HandleFloodfillDatabaseStoreMessageJob extends JobImpl {
|
||||
_log.shouldLog(Log.WARN))
|
||||
_log.warn("Blocklisting new peer " + key + ' ' + ri);
|
||||
} else {
|
||||
Set oldAddr = prevNetDb.getAddresses();
|
||||
Set newAddr = ri.getAddresses();
|
||||
if (newAddr != null && (!newAddr.equals(oldAddr)) &&
|
||||
Collection<RouterAddress> oldAddr = prevNetDb.getAddresses();
|
||||
Collection<RouterAddress> newAddr = ri.getAddresses();
|
||||
if ((!newAddr.equals(oldAddr)) &&
|
||||
(!getContext().shitlist().isShitlistedForever(key)) &&
|
||||
getContext().blocklist().isBlocklisted(key) &&
|
||||
_log.shouldLog(Log.WARN))
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.net.UnknownHostException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -1258,7 +1259,7 @@ public class ProfileOrganizer {
|
||||
RouterInfo pinfo = _context.netDb().lookupRouterInfoLocally(peer);
|
||||
if (pinfo == null)
|
||||
return rv;
|
||||
Set<RouterAddress> paddr = pinfo.getAddresses();
|
||||
Collection<RouterAddress> paddr = pinfo.getAddresses();
|
||||
if (paddr == null)
|
||||
return rv;
|
||||
for (RouterAddress pa : paddr) {
|
||||
|
||||
Reference in New Issue
Block a user