mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
don't use netDb subcriptions anymore
This commit is contained in:
parent
c92d99718b
commit
a046af1806
6 changed files with 45 additions and 56 deletions
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 ();)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue