mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
don't use netDb subcriptions anymore
This commit is contained in:
30
NetDb.cpp
30
NetDb.cpp
@@ -149,7 +149,6 @@ namespace data
|
||||
{
|
||||
SaveUpdated (m_NetDbPath);
|
||||
ManageLeaseSets ();
|
||||
ValidateSubscriptions ();
|
||||
}
|
||||
lastSave = ts;
|
||||
}
|
||||
@@ -856,35 +855,6 @@ namespace data
|
||||
return r;
|
||||
}
|
||||
|
||||
void NetDb::Subscribe (const IdentHash& ident, i2p::tunnel::TunnelPool * pool)
|
||||
{
|
||||
LeaseSet * leaseSet = FindLeaseSet (ident);
|
||||
if (!leaseSet)
|
||||
{
|
||||
LogPrint ("LeaseSet requested");
|
||||
RequestDestination (ident, true, pool);
|
||||
}
|
||||
m_Subscriptions[ident] = pool;
|
||||
}
|
||||
|
||||
void NetDb::Unsubscribe (const IdentHash& ident)
|
||||
{
|
||||
m_Subscriptions.erase (ident);
|
||||
}
|
||||
|
||||
void NetDb::ValidateSubscriptions ()
|
||||
{
|
||||
for (auto it : m_Subscriptions)
|
||||
{
|
||||
LeaseSet * leaseSet = FindLeaseSet (it.first);
|
||||
if (!leaseSet || leaseSet->HasExpiredLeases ())
|
||||
{
|
||||
LogPrint ("LeaseSet re-requested");
|
||||
RequestDestination (it.first, true, it.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NetDb::ManageLeaseSets ()
|
||||
{
|
||||
for (auto it = m_LeaseSets.begin (); it != m_LeaseSets.end ();)
|
||||
|
||||
Reference in New Issue
Block a user