mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
delete obsolete requested destination
This commit is contained in:
parent
e0291bb815
commit
a01e2213eb
2 changed files with 8 additions and 2 deletions
|
@ -29,6 +29,7 @@ namespace data
|
|||
m_ExcludedPeers.insert (router->GetIdentHash ());
|
||||
m_LastRouter = router;
|
||||
m_LastReplyTunnel = replyTunnel;
|
||||
m_CreationTime = i2p::util::GetSecondsSinceEpoch ();
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -39,6 +40,7 @@ namespace data
|
|||
m_ExcludedPeers.insert (floodfill);
|
||||
m_LastRouter = nullptr;
|
||||
m_LastReplyTunnel = nullptr;
|
||||
m_CreationTime = i2p::util::GetSecondsSinceEpoch ();
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -543,9 +545,10 @@ namespace data
|
|||
void NetDb::Explore (int numDestinations)
|
||||
{
|
||||
// clean up previous exploratories
|
||||
uint64_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
for (auto it = m_RequestedDestinations.begin (); it != m_RequestedDestinations.end ();)
|
||||
{
|
||||
if (it->second->IsExploratory ())
|
||||
if (it->second->IsExploratory () || ts > it->second->GetCreationTime () + 60) // no response for 1 minute
|
||||
{
|
||||
delete it->second;
|
||||
it = m_RequestedDestinations.erase (it);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue