aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarko Bencun <marko.bencun@monetas.net>2017-02-22 16:12:37 +0900
committerMarko Bencun <marko.bencun@monetas.net>2017-02-22 20:32:47 +0900
commit4b183d33f3647714bb6eb39e1d1c3e54d2b2aaec (patch)
treef41586cd8db0d4eaec423a012e973cc3c100a342 /src/init.cpp
parent5628c70f2a44567695e5331fe2293c5b7f35b629 (diff)
downloadbitcoin-4b183d33f3647714bb6eb39e1d1c3e54d2b2aaec.tar.xz
Remove block file location upgrade code
An effort to reduce the size of AppInitMain(). The removed code upgrades the location of the block files when upgrading to 0.8. 0.8 seems to be the oldest version still in use.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/init.cpp b/src/init.cpp
index cf265180ff..cf4b75a849 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1353,32 +1353,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);