rename method

This commit is contained in:
zzz
2019-05-09 11:31:06 +00:00
parent 585778cddc
commit cbeaca66a2
8 changed files with 12 additions and 12 deletions

View File

@ -114,13 +114,13 @@ public abstract class CommSystemFacade implements Service {
public String getOurCountry() { return null; }
/** @since 0.8.13 */
public boolean isInBadCountry() { return false; }
public boolean isInStrictCountry() { return false; }
/** @since 0.9.16 */
public boolean isInBadCountry(Hash peer) { return false; }
public boolean isInStrictCountry(Hash peer) { return false; }
/** @since 0.9.16 */
public boolean isInBadCountry(RouterInfo ri) { return false; }
public boolean isInStrictCountry(RouterInfo ri) { return false; }
public String getCountry(Hash peer) { return null; }
public String getCountryName(String code) { return code; }

View File

@ -1164,7 +1164,7 @@ public class Router implements RouterClock.ClockShiftListener {
String h = _context.getProperty(PROP_HIDDEN_HIDDEN);
if (h != null)
return Boolean.parseBoolean(h);
return _context.commSystem().isInBadCountry();
return _context.commSystem().isInStrictCountry();
}
/**

View File

@ -125,7 +125,7 @@ class FloodfillMonitorJob extends JobImpl {
if (!getContext().getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP))
return false;
if (getContext().commSystem().isInBadCountry())
if (getContext().commSystem().isInStrictCountry())
return false;
String country = getContext().commSystem().getOurCountry();
// anonymous proxy, satellite provider (not in bad country list)

View File

@ -253,7 +253,7 @@ class FloodfillPeerSelector extends PeerSelector {
badff.add(entry);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Old: " + entry);
} else if (info != null && _context.commSystem().isInBadCountry(info)) {
} else if (info != null && _context.commSystem().isInStrictCountry(info)) {
badff.add(entry);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Bad country: " + entry);

View File

@ -112,7 +112,7 @@ public class ReseedBundler {
continue;
if (!hasIPv4)
continue;
if (_context.commSystem().isInBadCountry(ri))
if (_context.commSystem().isInStrictCountry(ri))
continue;
toWrite.add(ri);

View File

@ -1391,7 +1391,7 @@ public class ProfileOrganizer {
// don't allow them in the high-cap pool, what would the point of that be?
if (_thresholdCapacityValue <= profile.getCapacityValue() &&
isSelectable(peer) &&
!_context.commSystem().isInBadCountry(peer)) {
!_context.commSystem().isInStrictCountry(peer)) {
_highCapacityPeers.put(peer, profile);
if (_log.shouldLog(Log.DEBUG))
_log.debug("High capacity: \t" + peer);

View File

@ -436,7 +436,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
* @since 0.8.13
*/
@Override
public boolean isInBadCountry() {
public boolean isInStrictCountry() {
String us = getOurCountry();
return (us != null && StrictCountries.contains(us)) || _context.getBooleanProperty("router.forceBadCountry");
}
@ -447,7 +447,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
* @since 0.9.16
*/
@Override
public boolean isInBadCountry(Hash peer) {
public boolean isInStrictCountry(Hash peer) {
String c = getCountry(peer);
return c != null && StrictCountries.contains(c);
}
@ -458,7 +458,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
* @since 0.9.16
*/
@Override
public boolean isInBadCountry(RouterInfo ri) {
public boolean isInStrictCountry(RouterInfo ri) {
byte[] ip = getIP(ri);
if (ip == null)
return false;

View File

@ -483,7 +483,7 @@ public class GeoIP {
String country = ctx.commSystem().getCountry(ourHash);
if (country != null && !country.equals(oldCountry)) {
ctx.router().saveConfig(PROP_IP_COUNTRY, country);
if (ctx.commSystem().isInBadCountry() && ctx.getProperty(Router.PROP_HIDDEN_HIDDEN) == null) {
if (ctx.commSystem().isInStrictCountry() && ctx.getProperty(Router.PROP_HIDDEN_HIDDEN) == null) {
String name = fullName(country);
if (name == null)
name = country;