|
|
@ -555,26 +555,26 @@ namespace client |
|
|
|
shared_from_this (), std::placeholders::_1)); |
|
|
|
shared_from_this (), std::placeholders::_1)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
auto outbound = m_Pool->GetNextOutboundTunnel (); |
|
|
|
auto floodfill = i2p::data::netdb.GetClosestFloodfill (leaseSet->GetIdentHash (), m_ExcludedFloodfills); |
|
|
|
|
|
|
|
if (!floodfill) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet, no more floodfills found"); |
|
|
|
|
|
|
|
m_ExcludedFloodfills.clear (); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
m_ExcludedFloodfills.insert (floodfill->GetIdentHash ()); |
|
|
|
|
|
|
|
auto outbound = m_Pool->GetNextOutboundTunnel (nullptr, floodfill->GetCompatibleTransports (false)); |
|
|
|
if (!outbound) |
|
|
|
if (!outbound) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet. No outbound tunnels"); |
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet. No outbound tunnels"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
auto inbound = m_Pool->GetNextInboundTunnel (); |
|
|
|
auto inbound = m_Pool->GetNextInboundTunnel (nullptr, floodfill->GetCompatibleTransports (true)); |
|
|
|
if (!inbound) |
|
|
|
if (!inbound) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet. No inbound tunnels"); |
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet. No inbound tunnels"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
auto floodfill = i2p::data::netdb.GetClosestFloodfill (leaseSet->GetIdentHash (), m_ExcludedFloodfills); |
|
|
|
|
|
|
|
if (!floodfill) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "Destination: Can't publish LeaseSet, no more floodfills found"); |
|
|
|
|
|
|
|
m_ExcludedFloodfills.clear (); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
m_ExcludedFloodfills.insert (floodfill->GetIdentHash ()); |
|
|
|
|
|
|
|
LogPrint (eLogDebug, "Destination: Publish LeaseSet of ", GetIdentHash ().ToBase32 ()); |
|
|
|
LogPrint (eLogDebug, "Destination: Publish LeaseSet of ", GetIdentHash ().ToBase32 ()); |
|
|
|
RAND_bytes ((uint8_t *)&m_PublishReplyToken, 4); |
|
|
|
RAND_bytes ((uint8_t *)&m_PublishReplyToken, 4); |
|
|
|
auto msg = WrapMessageForRouter (floodfill, i2p::CreateDatabaseStoreMsg (leaseSet, m_PublishReplyToken, inbound)); |
|
|
|
auto msg = WrapMessageForRouter (floodfill, i2p::CreateDatabaseStoreMsg (leaseSet, m_PublishReplyToken, inbound)); |
|
|
@ -751,10 +751,10 @@ namespace client |
|
|
|
std::shared_ptr<const i2p::data::RouterInfo> nextFloodfill, std::shared_ptr<LeaseSetRequest> request) |
|
|
|
std::shared_ptr<const i2p::data::RouterInfo> nextFloodfill, std::shared_ptr<LeaseSetRequest> request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!request->replyTunnel || !request->replyTunnel->IsEstablished ()) |
|
|
|
if (!request->replyTunnel || !request->replyTunnel->IsEstablished ()) |
|
|
|
request->replyTunnel = m_Pool->GetNextInboundTunnel (); |
|
|
|
request->replyTunnel = m_Pool->GetNextInboundTunnel (nullptr, nextFloodfill->GetCompatibleTransports (true)); |
|
|
|
if (!request->replyTunnel) LogPrint (eLogError, "Destination: Can't send LeaseSet request, no inbound tunnels found"); |
|
|
|
if (!request->replyTunnel) LogPrint (eLogError, "Destination: Can't send LeaseSet request, no inbound tunnels found"); |
|
|
|
if (!request->outboundTunnel || !request->outboundTunnel->IsEstablished ()) |
|
|
|
if (!request->outboundTunnel || !request->outboundTunnel->IsEstablished ()) |
|
|
|
request->outboundTunnel = m_Pool->GetNextOutboundTunnel (); |
|
|
|
request->outboundTunnel = m_Pool->GetNextOutboundTunnel (nullptr, nextFloodfill->GetCompatibleTransports (false)); |
|
|
|
if (!request->outboundTunnel) LogPrint (eLogError, "Destination: Can't send LeaseSet request, no outbound tunnels found"); |
|
|
|
if (!request->outboundTunnel) LogPrint (eLogError, "Destination: Can't send LeaseSet request, no outbound tunnels found"); |
|
|
|
|
|
|
|
|
|
|
|
if (request->replyTunnel && request->outboundTunnel) |
|
|
|
if (request->replyTunnel && request->outboundTunnel) |
|
|
|