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