Browse Source

Revert "check for valid LS before updating"

This reverts commit e070ce4e34.
pull/1073/head
Jeff Becker 7 years ago
parent
commit
3820b51960
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
  1. 20
      libi2pd/NetDb.cpp

20
libi2pd/NetDb.cpp

@ -237,17 +237,19 @@ namespace data @@ -237,17 +237,19 @@ namespace data
auto it = m_LeaseSets.find(ident);
if (it != m_LeaseSets.end ())
{
/* make sure LS is valid before updating */
LeaseSet ls(buf, len, false);
if(!ls.IsValid())
{
LogPrint(eLogInfo, "NetDb: Updated LeaseSet is Invalid: ", ident.ToBase32());
}
else if (it->second->IsNewer (buf, len))
if (it->second->IsNewer (buf, len))
{
it->second->Update (buf, len);
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32());
updated = true;
if (it->second->IsValid ())
{
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32());
updated = true;
}
else
{
LogPrint (eLogWarning, "NetDb: LeaseSet update failed: ", ident.ToBase32());
m_LeaseSets.erase (it);
}
}
else
LogPrint (eLogDebug, "NetDb: LeaseSet is older: ", ident.ToBase32());

Loading…
Cancel
Save