diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-02-28 12:30:12 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-02-28 12:31:33 +0100 |
commit | b7547fa93e013b5bfec03ab87cb2f5c5416104e4 (patch) | |
tree | 0796c7731f51f4c5afacae840573779dd3af252d /src | |
parent | c322fa472efa081068dbbcf9ccb5ca4342a41d2e (diff) | |
parent | 4b183d33f3647714bb6eb39e1d1c3e54d2b2aaec (diff) |
Merge #9822: Remove block file location upgrade code
4b183d3 Remove block file location upgrade code (Marko Bencun)
Tree-SHA512: fac1fce95341e0df645c08c7e794195b22b54df08826aa8728f2f97aede1e42f724f8133781b97f836d4a392d044d08c846bce471a6b478582014f8be501a712
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/init.cpp b/src/init.cpp index 22c8974a59..1c8c3bc620 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1365,32 +1365,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) fReindex = GetBoolArg("-reindex", false); bool fReindexChainState = GetBoolArg("-reindex-chainstate", 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; - } - } + boost::filesystem::create_directories(GetDataDir() / "blocks"); // cache size calculations int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20); |