Skip to content

Commit faf48f2

Browse files
author
MarcoFalke
committed
log: Clarify log message when file does not exist
Also, run clang-format on the function
1 parent db656db commit faf48f2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/addrdb.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ template <typename Data>
109109
bool DeserializeFileDB(const fs::path& path, Data& data)
110110
{
111111
// open input file, and associate with CAutoFile
112-
FILE *file = fsbridge::fopen(path, "rb");
112+
FILE* file = fsbridge::fopen(path, "rb");
113113
CAutoFile filein(file, SER_DISK, CLIENT_VERSION);
114-
if (filein.IsNull())
115-
return error("%s: Failed to open file %s", __func__, path.string());
116-
114+
if (filein.IsNull()) {
115+
LogPrintf("Missing or invalid file %s\n", path.string());
116+
return false;
117+
}
117118
return DeserializeDB(filein, data);
118119
}
119-
120-
}
120+
} // namespace
121121

122122
CBanDB::CBanDB(fs::path ban_list_path) : m_ban_list_path(std::move(ban_list_path))
123123
{

src/banman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t
2828
LogPrint(BCLog::NET, "Loaded %d banned node ips/subnets from banlist.dat %dms\n",
2929
m_banned.size(), GetTimeMillis() - n_start);
3030
} else {
31-
LogPrintf("Invalid or missing banlist.dat; recreating\n");
31+
LogPrintf("Recreating banlist.dat\n");
3232
SetBannedSetDirty(true); // force write
3333
DumpBanlist();
3434
}

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
23912391
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman.size(), GetTimeMillis() - nStart);
23922392
else {
23932393
addrman.Clear(); // Addrman can be in an inconsistent state after failure, reset it
2394-
LogPrintf("Invalid or missing peers.dat; recreating\n");
2394+
LogPrintf("Recreating peers.dat\n");
23952395
DumpAddresses();
23962396
}
23972397
}

0 commit comments

Comments
 (0)