|
|
@ -237,22 +237,20 @@ 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)) |
|
|
|
uint64_t expires; |
|
|
|
|
|
|
|
if(LeaseSetBufferValidate(buf, len, expires)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
it->second->Update (buf, len); |
|
|
|
if(it->second->GetExpirationTime() < expires) |
|
|
|
if (it->second->IsValid ()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
it->second->Update (buf, len); |
|
|
|
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32()); |
|
|
|
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32()); |
|
|
|
updated = true; |
|
|
|
updated = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
LogPrint(eLogDebug, "NetDb: LeaseSet is older: ", ident.ToBase32()); |
|
|
|
LogPrint (eLogWarning, "NetDb: LeaseSet update failed: ", ident.ToBase32()); |
|
|
|
|
|
|
|
m_LeaseSets.erase (it); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogDebug, "NetDb: LeaseSet is older: ", ident.ToBase32()); |
|
|
|
LogPrint(eLogError, "NetDb: LeaseSet is invalid: ", ident.ToBase32()); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|