* Addressbook: don't save to disk if address map is empty
This commit is contained in:
@@ -161,6 +161,11 @@ namespace client
|
|||||||
|
|
||||||
int AddressBookFilesystemStorage::Save (const std::map<std::string, i2p::data::IdentHash>& addresses)
|
int AddressBookFilesystemStorage::Save (const std::map<std::string, i2p::data::IdentHash>& addresses)
|
||||||
{
|
{
|
||||||
|
if (addresses.size() == 0) {
|
||||||
|
LogPrint(eLogWarning, "Addressbook: not saving empty addressbook");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
auto filename = GetPath () / "addresses.csv";
|
auto filename = GetPath () / "addresses.csv";
|
||||||
std::ofstream f (filename.string (), std::ofstream::out); // in text mode
|
std::ofstream f (filename.string (), std::ofstream::out); // in text mode
|
||||||
|
Reference in New Issue
Block a user