mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-18 23:36:39 +01:00
cleanup requested destinations
This commit is contained in:
parent
2e0e6fc6c4
commit
f2f4a0b04e
1 changed files with 12 additions and 0 deletions
12
NetDb.cpp
12
NetDb.cpp
|
@ -537,6 +537,18 @@ namespace data
|
||||||
|
|
||||||
void NetDb::Explore (int numDestinations)
|
void NetDb::Explore (int numDestinations)
|
||||||
{
|
{
|
||||||
|
// clean up previous exploratories
|
||||||
|
for (auto it = m_RequestedDestinations.begin (); it != m_RequestedDestinations.end ();)
|
||||||
|
{
|
||||||
|
if (it->second->IsExploratory ())
|
||||||
|
{
|
||||||
|
delete it->second;
|
||||||
|
it = m_RequestedDestinations.erase (it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
// new requests
|
||||||
auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
||||||
auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr;
|
auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr;
|
||||||
auto inbound = exploratoryPool ? exploratoryPool->GetNextInboundTunnel () : nullptr;
|
auto inbound = exploratoryPool ? exploratoryPool->GetNextInboundTunnel () : nullptr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue