Skip to content

Commit c77c662

Browse files
committed
peers.dat, banlist.dat recreated when missing
1 parent 196ad69 commit c77c662

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/net.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,8 +1941,10 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
19411941
CAddrDB adb;
19421942
if (adb.Read(addrman))
19431943
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman.size(), GetTimeMillis() - nStart);
1944-
else
1944+
else {
19451945
LogPrintf("Invalid or missing peers.dat; recreating\n");
1946+
DumpAddresses();
1947+
}
19461948
}
19471949

19481950
uiInterface.InitMessage(_("Loading banlist..."));
@@ -1957,8 +1959,11 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
19571959

19581960
LogPrint("net", "Loaded %d banned node ips/subnets from banlist.dat %dms\n",
19591961
banmap.size(), GetTimeMillis() - nStart);
1960-
} else
1962+
} else {
19611963
LogPrintf("Invalid or missing banlist.dat; recreating\n");
1964+
CNode::SetBannedSetDirty(true); // force write
1965+
DumpBanlist();
1966+
}
19621967

19631968
fAddressesInitialized = true;
19641969

0 commit comments

Comments
 (0)