aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/addrdb.cpp')
-rw-r--r--src/addrdb.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/addrdb.cpp b/src/addrdb.cpp
index 8f77ed35ce..c376aced10 100644
--- a/src/addrdb.cpp
+++ b/src/addrdb.cpp
@@ -43,7 +43,7 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
std::string tmpfn = strprintf("%s.%04x", prefix, randv);
// open temp output file, and associate with CAutoFile
- fs::path pathTmp = GetDataDir() / tmpfn;
+ fs::path pathTmp = gArgs.GetDataDirNet() / tmpfn;
FILE *file = fsbridge::fopen(pathTmp, "wb");
CAutoFile fileout(file, SER_DISK, CLIENT_VERSION);
if (fileout.IsNull()) {
@@ -109,15 +109,15 @@ template <typename Data>
bool DeserializeFileDB(const fs::path& path, Data& data)
{
// open input file, and associate with CAutoFile
- FILE *file = fsbridge::fopen(path, "rb");
+ FILE* file = fsbridge::fopen(path, "rb");
CAutoFile filein(file, SER_DISK, CLIENT_VERSION);
- if (filein.IsNull())
- return error("%s: Failed to open file %s", __func__, path.string());
-
+ if (filein.IsNull()) {
+ LogPrintf("Missing or invalid file %s\n", path.string());
+ return false;
+ }
return DeserializeDB(filein, data);
}
-
-}
+} // namespace
CBanDB::CBanDB(fs::path ban_list_path) : m_ban_list_path(std::move(ban_list_path))
{
@@ -135,7 +135,7 @@ bool CBanDB::Read(banmap_t& banSet)
CAddrDB::CAddrDB()
{
- pathAddr = GetDataDir() / "peers.dat";
+ pathAddr = gArgs.GetDataDirNet() / "peers.dat";
}
bool CAddrDB::Write(const CAddrMan& addr)