mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
doesn't store leases in netdb
This commit is contained in:
parent
76096747b6
commit
f3b277aeef
6 changed files with 47 additions and 30 deletions
|
@ -206,7 +206,7 @@ namespace data
|
|||
}
|
||||
else
|
||||
{
|
||||
auto leaseSet = std::make_shared<LeaseSet> (buf, len);
|
||||
auto leaseSet = std::make_shared<LeaseSet> (buf, len, false); // we don't need leases in netdb
|
||||
if (leaseSet->IsValid ())
|
||||
{
|
||||
LogPrint (eLogInfo, "NetDb: LeaseSet added: ", ident.ToBase64());
|
||||
|
@ -981,9 +981,10 @@ namespace data
|
|||
|
||||
void NetDb::ManageLeaseSets ()
|
||||
{
|
||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
for (auto it = m_LeaseSets.begin (); it != m_LeaseSets.end ();)
|
||||
{
|
||||
if (!it->second->HasNonExpiredLeases ()) // all leases expired
|
||||
if (ts > it->second->GetExpirationTime ())
|
||||
{
|
||||
LogPrint (eLogWarning, "NetDb: LeaseSet ", it->second->GetIdentHash ().ToBase64 (), " expired");
|
||||
it = m_LeaseSets.erase (it);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue