mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-12 01:57:55 +00:00
don't try to save invalid router
This commit is contained in:
parent
8981e406f5
commit
e26682f4cb
@ -654,7 +654,7 @@ namespace data
|
||||
std::string ident = it.second->GetIdentHashBase64();
|
||||
if (it.second->IsUpdated ())
|
||||
{
|
||||
if (it.second->GetBuffer ())
|
||||
if (it.second->GetBuffer () && !it.second->IsUnreachable ())
|
||||
{
|
||||
// we have something to save
|
||||
std::shared_ptr<RouterInfo::Buffer> buffer;
|
||||
@ -663,9 +663,8 @@ namespace data
|
||||
buffer = it.second->CopyBuffer ();
|
||||
it.second->ScheduleBufferToDelete ();
|
||||
}
|
||||
if (buffer && !it.second->IsUnreachable ()) // don't save bad router
|
||||
if (buffer)
|
||||
saveToDisk.push_back(std::make_pair(ident, buffer));
|
||||
it.second->SetUnreachable (false);
|
||||
}
|
||||
it.second->SetUpdated (false);
|
||||
updatedCount++;
|
||||
|
@ -293,7 +293,7 @@ namespace data
|
||||
void DeleteBuffer () { m_Buffer = nullptr; m_IsBufferScheduledToDelete = false; };
|
||||
std::shared_ptr<Buffer> GetSharedBuffer () const { return m_Buffer; };
|
||||
std::shared_ptr<Buffer> CopyBuffer () const;
|
||||
void ScheduleBufferToDelete () { m_IsBufferScheduledToDelete = false; };
|
||||
void ScheduleBufferToDelete () { m_IsBufferScheduledToDelete = true; };
|
||||
bool IsBufferScheduledToDelete () const { return m_IsBufferScheduledToDelete; };
|
||||
|
||||
bool IsUpdated () const { return m_IsUpdated; };
|
||||
|
Loading…
Reference in New Issue
Block a user