Skip to content

Commit 8f51826

Browse files
committed
p2p: log a message instead of error on missing anchors.dat
1 parent e4f0c4c commit 8f51826

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/addrdb.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ void DumpAnchors(const fs::path& anchors_db_path, const std::vector<CAddress>& a
167167
std::vector<CAddress> ReadAnchors(const fs::path& anchors_db_path)
168168
{
169169
std::vector<CAddress> anchors;
170-
if (DeserializeFileDB(anchors_db_path, anchors)) {
170+
if (!fs::exists(anchors_db_path)) {
171+
LogPrintf("Could not find anchors file %s\n", anchors_db_path);
172+
anchors.clear();
173+
} else if (DeserializeFileDB(anchors_db_path, anchors)) {
171174
LogPrintf("Loaded %i addresses from %s\n", anchors.size(), anchors_db_path.filename());
172175
} else {
173176
anchors.clear();

0 commit comments

Comments
 (0)