aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirkalx <kirkalx@yahoo.co.nz>2016-02-02 22:45:11 +1300
committerkirkalx <kirkalx@yahoo.co.nz>2016-02-04 11:46:24 +1300
commitc77c6625f3fc88e461a9ec11672edb6a9d4cfd98 (patch)
treeac9e77e011a19acf593319c82b007a4fffb82eb4
parent196ad6913ff57cd39caf0b262267e67c5a143467 (diff)
peers.dat, banlist.dat recreated when missing
-rw-r--r--src/net.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 48e9e10157..be00b2d3d4 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1941,8 +1941,10 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
CAddrDB adb;
if (adb.Read(addrman))
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman.size(), GetTimeMillis() - nStart);
- else
+ else {
LogPrintf("Invalid or missing peers.dat; recreating\n");
+ DumpAddresses();
+ }
}
uiInterface.InitMessage(_("Loading banlist..."));
@@ -1957,8 +1959,11 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrint("net", "Loaded %d banned node ips/subnets from banlist.dat %dms\n",
banmap.size(), GetTimeMillis() - nStart);
- } else
+ } else {
LogPrintf("Invalid or missing banlist.dat; recreating\n");
+ CNode::SetBannedSetDirty(true); // force write
+ DumpBanlist();
+ }
fAddressesInitialized = true;