Skip to content

Commit 8264e15

Browse files
laanwjPastaPastaPasta
authored andcommitted
Merge bitcoin#9822: Remove block file location upgrade code
4b183d3 Remove block file location upgrade code (Marko Bencun) Tree-SHA512: fac1fce95341e0df645c08c7e794195b22b54df08826aa8728f2f97aede1e42f724f8133781b97f836d4a392d044d08c846bce471a6b478582014f8be501a712
1 parent f51d2e0 commit 8264e15

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/init.cpp

+1-26
Original file line numberDiff line numberDiff line change
@@ -1675,32 +1675,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
16751675
fReindex = GetBoolArg("-reindex", false);
16761676
bool fReindexChainState = GetBoolArg("-reindex-chainstate", false);
16771677

1678-
// Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/
1679-
boost::filesystem::path blocksDir = GetDataDir() / "blocks";
1680-
if (!boost::filesystem::exists(blocksDir))
1681-
{
1682-
boost::filesystem::create_directories(blocksDir);
1683-
bool linked = false;
1684-
for (unsigned int i = 1; i < 10000; i++) {
1685-
boost::filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i);
1686-
if (!boost::filesystem::exists(source)) break;
1687-
boost::filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1);
1688-
try {
1689-
boost::filesystem::create_hard_link(source, dest);
1690-
LogPrintf("Hardlinked %s -> %s\n", source.string(), dest.string());
1691-
linked = true;
1692-
} catch (const boost::filesystem::filesystem_error& e) {
1693-
// Note: hardlink creation failing is not a disaster, it just means
1694-
// blocks will get re-downloaded from peers.
1695-
LogPrintf("Error hardlinking blk%04u.dat: %s\n", i, e.what());
1696-
break;
1697-
}
1698-
}
1699-
if (linked)
1700-
{
1701-
fReindex = true;
1702-
}
1703-
}
1678+
boost::filesystem::create_directories(GetDataDir() / "blocks");
17041679

17051680
// cache size calculations
17061681
int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20);

0 commit comments

Comments
 (0)