forked from I2P_Developers/i2p.i2p
- Only store LS with more than 6 leases to routers that support it
This commit is contained in:
@ -171,6 +171,12 @@ class StoreJob extends JobImpl {
|
|||||||
if (_log.shouldLog(Log.INFO))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.info(getJobId() + ": Skipping router that doesn't support key certs " + peer + " : " + ds);
|
_log.info(getJobId() + ": Skipping router that doesn't support key certs " + peer + " : " + ds);
|
||||||
_state.addSkipped(peer);
|
_state.addSkipped(peer);
|
||||||
|
} else if (_state.getData().getType() == DatabaseEntry.KEY_TYPE_LEASESET &&
|
||||||
|
((LeaseSet)_state.getData()).getLeaseCount() > 6 &&
|
||||||
|
!supportsBigLeaseSets((RouterInfo)ds)) {
|
||||||
|
if (_log.shouldLog(Log.INFO))
|
||||||
|
_log.info(getJobId() + ": Skipping router that doesn't support big leasesets " + peer + " : " + ds);
|
||||||
|
_state.addSkipped(peer);
|
||||||
} else {
|
} else {
|
||||||
int peerTimeout = _facade.getPeerTimeout(peer);
|
int peerTimeout = _facade.getPeerTimeout(peer);
|
||||||
|
|
||||||
@ -508,6 +514,19 @@ class StoreJob extends JobImpl {
|
|||||||
return VersionComparator.comp(v, MIN_KEYCERT_VERSION) >= 0;
|
return VersionComparator.comp(v, MIN_KEYCERT_VERSION) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String MIN_BIGLEASESET_VERSION = "0.9";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does he support more than 6 leasesets?
|
||||||
|
* @since 0.9.11
|
||||||
|
*/
|
||||||
|
private static boolean supportsBigLeaseSets(RouterInfo ri) {
|
||||||
|
String v = ri.getOption("router.version");
|
||||||
|
if (v == null)
|
||||||
|
return false;
|
||||||
|
return VersionComparator.comp(v, MIN_BIGLEASESET_VERSION) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after sending a dbStore to a peer successfully,
|
* Called after sending a dbStore to a peer successfully,
|
||||||
* marking the store as successful
|
* marking the store as successful
|
||||||
|
Reference in New Issue
Block a user