aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/addrdb.cpp')
-rw-r--r--src/addrdb.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/addrdb.cpp b/src/addrdb.cpp
index 3f5916560e..f8d4240f3f 100644
--- a/src/addrdb.cpp
+++ b/src/addrdb.cpp
@@ -44,7 +44,8 @@ bool SerializeDB(Stream& stream, const Data& data)
hashwriter << Params().MessageStart() << data;
stream << hashwriter.GetHash();
} catch (const std::exception& e) {
- return error("%s: Serialize or I/O error - %s", __func__, e.what());
+ LogError("%s: Serialize or I/O error - %s\n", __func__, e.what());
+ return false;
}
return true;
@@ -64,7 +65,8 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
if (fileout.IsNull()) {
fileout.fclose();
remove(pathTmp);
- return error("%s: Failed to open file %s", __func__, fs::PathToString(pathTmp));
+ LogError("%s: Failed to open file %s\n", __func__, fs::PathToString(pathTmp));
+ return false;
}
// Serialize
@@ -76,14 +78,16 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
if (!FileCommit(fileout.Get())) {
fileout.fclose();
remove(pathTmp);
- return error("%s: Failed to flush file %s", __func__, fs::PathToString(pathTmp));
+ LogError("%s: Failed to flush file %s\n", __func__, fs::PathToString(pathTmp));
+ return false;
}
fileout.fclose();
// replace existing file, if any, with new file
if (!RenameOver(pathTmp, path)) {
remove(pathTmp);
- return error("%s: Rename-into-place failed", __func__);
+ LogError("%s: Rename-into-place failed\n", __func__);
+ return false;
}
return true;
@@ -140,7 +144,7 @@ bool CBanDB::Write(const banmap_t& banSet)
}
for (const auto& err : errors) {
- error("%s", err);
+ LogError("%s\n", err);
}
return false;
}