Skip to content

Commit b7547fa

Browse files
committed
Merge #9822: Remove block file location upgrade code
4b183d3 Remove block file location upgrade code (Marko Bencun) Tree-SHA512: fac1fce95341e0df645c08c7e794195b22b54df08826aa8728f2f97aede1e42f724f8133781b97f836d4a392d044d08c846bce471a6b478582014f8be501a712
2 parents c322fa4 + 4b183d3 commit b7547fa

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/init.cpp

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,32 +1365,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13651365
fReindex = GetBoolArg("-reindex", false);
13661366
bool fReindexChainState = GetBoolArg("-reindex-chainstate", false);
13671367

1368-
// Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/
1369-
boost::filesystem::path blocksDir = GetDataDir() / "blocks";
1370-
if (!boost::filesystem::exists(blocksDir))
1371-
{
1372-
boost::filesystem::create_directories(blocksDir);
1373-
bool linked = false;
1374-
for (unsigned int i = 1; i < 10000; i++) {
1375-
boost::filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i);
1376-
if (!boost::filesystem::exists(source)) break;
1377-
boost::filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1);
1378-
try {
1379-
boost::filesystem::create_hard_link(source, dest);
1380-
LogPrintf("Hardlinked %s -> %s\n", source.string(), dest.string());
1381-
linked = true;
1382-
} catch (const boost::filesystem::filesystem_error& e) {
1383-
// Note: hardlink creation failing is not a disaster, it just means
1384-
// blocks will get re-downloaded from peers.
1385-
LogPrintf("Error hardlinking blk%04u.dat: %s\n", i, e.what());
1386-
break;
1387-
}
1388-
}
1389-
if (linked)
1390-
{
1391-
fReindex = true;
1392-
}
1393-
}
1368+
boost::filesystem::create_directories(GetDataDir() / "blocks");
13941369

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

0 commit comments

Comments
 (0)