don't use netDb subcriptions anymore

This commit is contained in:
orignal 2014-10-15 12:07:06 -04:00
parent c92d99718b
commit a046af1806
6 changed files with 45 additions and 56 deletions

View file

@ -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 ();)