Browse Source

don't save invalid addreses

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

17
libi2pd_client/AddressBook.cpp

@ -198,13 +198,18 @@ namespace client @@ -198,13 +198,18 @@ namespace client
for (const auto& it: addresses)
{
f << it.first << ",";
if (it.second->IsIdentHash ())
f << it.second->identHash.ToBase32 ();
if (it.second->IsValid ())
{
f << it.first << ",";
if (it.second->IsIdentHash ())
f << it.second->identHash.ToBase32 ();
else
f << it.second->blindedPublicKey->ToB33 ();
f << std::endl;
num++;
}
else
f << it.second->blindedPublicKey->ToB33 ();
f << std::endl;
num++;
LogPrint (eLogWarning, "Addressbook: invalid address ", it.first);
}
LogPrint (eLogInfo, "Addressbook: ", num, " addresses saved");
return num;

Loading…
Cancel
Save