From afbf1a70827c6c0e6bec74497adeda81dcd8dd5f Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Thu, 28 Nov 2019 14:55:32 -0300 Subject: [PATCH 1/2] remove dead code in init --- src/init.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 4b1787358..4ed79e058 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1420,33 +1420,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) fReindex = GetBoolArg("-reindex", false); - // Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/ - boost::filesystem::path blocksDir = GetDataDir() / "blocks"; - if (!boost::filesystem::exists(blocksDir)) - { - boost::filesystem::create_directories(blocksDir); - bool linked = false; - for (unsigned int i = 1; i < 10000; i++) { - boost::filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i); - if (!boost::filesystem::exists(source)) break; - boost::filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1); - try { - boost::filesystem::create_hard_link(source, dest); - LogPrintf("Hardlinked %s -> %s\n", source.string(), dest.string()); - linked = true; - } catch (const boost::filesystem::filesystem_error& e) { - // Note: hardlink creation failing is not a disaster, it just means - // blocks will get re-downloaded from peers. - LogPrintf("Error hardlinking blk%04u.dat: %s\n", i, e.what()); - break; - } - } - if (linked) - { - fReindex = true; - } - } - // cache size calculations int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20); nTotalCache = std::max(nTotalCache, nMinDbCache << 20); // total cache cannot be less than nMinDbCache From c0d5b872774a7c108b3b5d586d23c6e59953a824 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Mon, 9 Dec 2019 18:04:06 -0300 Subject: [PATCH 2/2] readd create_directories --- src/init.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 4ed79e058..ff0171e7e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1420,6 +1420,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) fReindex = GetBoolArg("-reindex", false); + boost::filesystem::create_directories(GetDataDir() / "blocks"); + // cache size calculations int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20); nTotalCache = std::max(nTotalCache, nMinDbCache << 20); // total cache cannot be less than nMinDbCache