|
|
@ -1656,10 +1656,14 @@ namespace transport |
|
|
|
case eSSU2BlkRelayTagRequest: |
|
|
|
case eSSU2BlkRelayTagRequest: |
|
|
|
LogPrint (eLogDebug, "SSU2: RelayTagRequest"); |
|
|
|
LogPrint (eLogDebug, "SSU2: RelayTagRequest"); |
|
|
|
if (!m_RelayTag) |
|
|
|
if (!m_RelayTag) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
auto addr = FindLocalAddress (); |
|
|
|
|
|
|
|
if (addr && addr->IsIntroducer ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
RAND_bytes ((uint8_t *)&m_RelayTag, 4); |
|
|
|
RAND_bytes ((uint8_t *)&m_RelayTag, 4); |
|
|
|
m_Server.AddRelay (m_RelayTag, shared_from_this ()); |
|
|
|
m_Server.AddRelay (m_RelayTag, shared_from_this ()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case eSSU2BlkRelayTag: |
|
|
|
case eSSU2BlkRelayTag: |
|
|
|
LogPrint (eLogDebug, "SSU2: RelayTag"); |
|
|
|
LogPrint (eLogDebug, "SSU2: RelayTag"); |
|
|
@ -2478,6 +2482,8 @@ namespace transport |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (m_Address) |
|
|
|
if (m_Address) |
|
|
|
return i2p::context.GetRouterInfo ().GetSSU2Address (m_Address->IsV4 ()); |
|
|
|
return i2p::context.GetRouterInfo ().GetSSU2Address (m_Address->IsV4 ()); |
|
|
|
|
|
|
|
else if (!m_RemoteEndpoint.address ().is_unspecified ()) |
|
|
|
|
|
|
|
return i2p::context.GetRouterInfo ().GetSSU2Address (m_RemoteEndpoint.address ().is_v4 ()); |
|
|
|
return nullptr; |
|
|
|
return nullptr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|