mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
don't try to save unreachable routers
This commit is contained in:
parent
88f19f551d
commit
7bde4de1f5
@ -595,14 +595,16 @@ namespace data
|
|||||||
|
|
||||||
bool RouterInfo::SaveToFile (const std::string& fullPath)
|
bool RouterInfo::SaveToFile (const std::string& fullPath)
|
||||||
{
|
{
|
||||||
|
if (m_IsUnreachable) return false; // don't save bad router
|
||||||
if (!m_Buffer)
|
if (!m_Buffer)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "RouterInfo: Can't save, m_Buffer == NULL");
|
LogPrint (eLogWarning, "RouterInfo: Can't save, m_Buffer == NULL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::ofstream f (fullPath, std::ofstream::binary | std::ofstream::out);
|
std::ofstream f (fullPath, std::ofstream::binary | std::ofstream::out);
|
||||||
if (!f.is_open ()) {
|
if (!f.is_open ())
|
||||||
LogPrint(eLogError, "RouterInfo: Can't save to ", fullPath);
|
{
|
||||||
|
LogPrint (eLogError, "RouterInfo: Can't save to ", fullPath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
f.write ((char *)m_Buffer->data (), m_BufferLen);
|
f.write ((char *)m_Buffer->data (), m_BufferLen);
|
||||||
|
Loading…
Reference in New Issue
Block a user