mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
validate leaseset for zero leases
This commit is contained in:
parent
9ce9d9b7fc
commit
d5e1d5db9c
4 changed files with 46 additions and 10 deletions
18
NetDb.cpp
18
NetDb.cpp
|
@ -252,12 +252,24 @@ namespace data
|
|||
if (it != m_LeaseSets.end ())
|
||||
{
|
||||
it->second->Update (buf, len);
|
||||
LogPrint ("LeaseSet updated");
|
||||
if (it->second->IsValid ())
|
||||
LogPrint (eLogInfo, "LeaseSet updated");
|
||||
else
|
||||
{
|
||||
LogPrint (eLogInfo, "LeaseSet update failed");
|
||||
m_LeaseSets.erase (it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint ("New LeaseSet added");
|
||||
m_LeaseSets[ident] = std::make_shared<LeaseSet> (buf, len);
|
||||
auto leaseSet = std::make_shared<LeaseSet> (buf, len);
|
||||
if (leaseSet->IsValid ())
|
||||
{
|
||||
LogPrint (eLogInfo, "New LeaseSet added");
|
||||
m_LeaseSets[ident] = leaseSet;
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "New LeaseSet validation failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue