mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
don't save invalid addreses
This commit is contained in:
parent
6fec92c012
commit
e7ff6fbffc
1 changed files with 11 additions and 6 deletions
|
@ -197,6 +197,8 @@ namespace client
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& it: addresses)
|
for (const auto& it: addresses)
|
||||||
|
{
|
||||||
|
if (it.second->IsValid ())
|
||||||
{
|
{
|
||||||
f << it.first << ",";
|
f << it.first << ",";
|
||||||
if (it.second->IsIdentHash ())
|
if (it.second->IsIdentHash ())
|
||||||
|
@ -206,6 +208,9 @@ namespace client
|
||||||
f << std::endl;
|
f << std::endl;
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
LogPrint (eLogWarning, "Addressbook: invalid address ", it.first);
|
||||||
|
}
|
||||||
LogPrint (eLogInfo, "Addressbook: ", num, " addresses saved");
|
LogPrint (eLogInfo, "Addressbook: ", num, " addresses saved");
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue