mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-23 17:34:21 +00:00
cleanup router's tags
This commit is contained in:
parent
b1aeae6772
commit
1062776762
@ -71,7 +71,7 @@ namespace data
|
|||||||
|
|
||||||
void NetDb::Run ()
|
void NetDb::Run ()
|
||||||
{
|
{
|
||||||
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0;
|
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0, lastDestinationCleanup = 0;
|
||||||
while (m_IsRunning)
|
while (m_IsRunning)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -121,7 +121,11 @@ namespace data
|
|||||||
}
|
}
|
||||||
lastSave = ts;
|
lastSave = ts;
|
||||||
}
|
}
|
||||||
|
if (ts - lastDestinationCleanup >= i2p::garlic::INCOMING_TAGS_EXPIRATION_TIMEOUT)
|
||||||
|
{
|
||||||
|
i2p::context.CleanupDestination ();
|
||||||
|
lastDestinationCleanup = ts;
|
||||||
|
}
|
||||||
// if we're in hidden mode don't publish or explore
|
// if we're in hidden mode don't publish or explore
|
||||||
// if (m_HiddenMode) continue;
|
// if (m_HiddenMode) continue;
|
||||||
|
|
||||||
|
@ -439,6 +439,12 @@ namespace i2p
|
|||||||
std::unique_lock<std::mutex> l(m_GarlicMutex);
|
std::unique_lock<std::mutex> l(m_GarlicMutex);
|
||||||
i2p::garlic::GarlicDestination::ProcessDeliveryStatusMessage (msg);
|
i2p::garlic::GarlicDestination::ProcessDeliveryStatusMessage (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RouterContext::CleanupDestination ()
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> l(m_GarlicMutex);
|
||||||
|
i2p::garlic::GarlicDestination::CleanupExpiredTags ();
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t RouterContext::GetUptime () const
|
uint32_t RouterContext::GetUptime () const
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,8 @@ namespace i2p
|
|||||||
void SetSupportsV4 (bool supportsV4);
|
void SetSupportsV4 (bool supportsV4);
|
||||||
|
|
||||||
void UpdateNTCPV6Address (const boost::asio::ip::address& host); // called from NTCP session
|
void UpdateNTCPV6Address (const boost::asio::ip::address& host); // called from NTCP session
|
||||||
void UpdateStats ();
|
void UpdateStats ();
|
||||||
|
void CleanupDestination (); // garlic destination
|
||||||
|
|
||||||
// implements LocalDestination
|
// implements LocalDestination
|
||||||
std::shared_ptr<const i2p::data::IdentityEx> GetIdentity () const { return m_Keys.GetPublic (); };
|
std::shared_ptr<const i2p::data::IdentityEx> GetIdentity () const { return m_Keys.GetPublic (); };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user