forked from I2P_Developers/i2p.i2p
SSU: Only advertise 'C' cap if we can really introduce
Only ask for relay tag if we don't have enough
This commit is contained in:
@@ -500,8 +500,9 @@ class EstablishmentManager {
|
||||
// TODO if already we have their RI, only offer if they need it (no 'C' cap)
|
||||
// if extended options, only if they asked for it
|
||||
if (state.isIntroductionRequested() &&
|
||||
_transport.canIntroduce() && state.getSentPort() >= 1024 &&
|
||||
state.getSentIP().length == 4) {
|
||||
state.getSentIP().length == 4 &&
|
||||
state.getSentPort() >= 1024 &&
|
||||
_transport.canIntroduce()) {
|
||||
// ensure > 0
|
||||
long tag = 1 + _context.random().nextLong(MAX_TAG_VALUE);
|
||||
state.setSentRelayTag(tag);
|
||||
|
||||
@@ -2491,7 +2491,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
|
||||
// if we have explicit external addresses, they had better be reachable
|
||||
String caps;
|
||||
if (introducersRequired) {
|
||||
if (introducersRequired || !canIntroduce()) {
|
||||
if (_context.getProperty(PROP_TRANSPORT_CAPS, ENABLE_TRANSPORT_CAPS))
|
||||
caps = CAP_TESTING_4;
|
||||
else
|
||||
@@ -2785,7 +2785,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
case IPV4_UNKNOWN_IPV6_OK:
|
||||
case IPV4_UNKNOWN_IPV6_FIREWALLED:
|
||||
case UNKNOWN:
|
||||
return true;
|
||||
return _introManager.introducerCount() < 2 * MIN_INTRODUCER_POOL;
|
||||
|
||||
default:
|
||||
return !allowDirectUDP();
|
||||
|
||||
Reference in New Issue
Block a user