Browse Source

don't save invalid addreses

pull/1550/head
orignal 4 years ago
parent
commit
e7ff6fbffc
  1. 5
      libi2pd_client/AddressBook.cpp

5
libi2pd_client/AddressBook.cpp

@ -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…
Cancel
Save