aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 13:26:57 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 13:29:54 +0100
commit5ca149a3db4a9f4e5ea93353494b40f2f1713e76 (patch)
tree16bcbe5588de1b0e98635e2e8d8e824a63f45935 /src/init.cpp
parent0e935865b9ee3a79fc63f5766074b6f539a0cf85 (diff)
parent2e29e7e247b6b74502c70612dab1f7f67de675c3 (diff)
downloadbitcoin-5ca149a3db4a9f4e5ea93353494b40f2f1713e76.tar.xz
Merge pull request #7053
2e29e7e Globals: Remove a bunch of Params() calls from main.cpp: (Jorge Timón)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3028802b93..3ae3e44406 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -592,6 +592,7 @@ void CleanupBlockRevFiles()
void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
{
+ const CChainParams& chainparams = Params();
RenameThread("bitcoin-loadblk");
// -reindex
if (fReindex) {
@@ -605,14 +606,14 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
if (!file)
break; // This error is logged in OpenBlockFile
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
- LoadExternalBlockFile(file, &pos);
+ LoadExternalBlockFile(chainparams, file, &pos);
nFile++;
}
pblocktree->WriteReindexing(false);
fReindex = false;
LogPrintf("Reindexing finished\n");
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
- InitBlockIndex();
+ InitBlockIndex(chainparams);
}
// hardcoded $DATADIR/bootstrap.dat
@@ -623,7 +624,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
CImportingNow imp;
boost::filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old";
LogPrintf("Importing bootstrap.dat...\n");
- LoadExternalBlockFile(file);
+ LoadExternalBlockFile(chainparams, file);
RenameOver(pathBootstrap, pathBootstrapOld);
} else {
LogPrintf("Warning: Could not open bootstrap file %s\n", pathBootstrap.string());
@@ -636,7 +637,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
if (file) {
CImportingNow imp;
LogPrintf("Importing blocks file %s...\n", path.string());
- LoadExternalBlockFile(file);
+ LoadExternalBlockFile(chainparams, file);
} else {
LogPrintf("Warning: Could not open blocks file %s\n", path.string());
}
@@ -1301,7 +1302,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
// Initialize the block index (no-op if non-empty database was already loaded)
- if (!InitBlockIndex()) {
+ if (!InitBlockIndex(chainparams)) {
strLoadError = _("Error initializing block database");
break;
}
@@ -1336,7 +1337,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
- if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", DEFAULT_CHECKLEVEL),
+ if (!CVerifyDB().VerifyDB(chainparams, pcoinsdbview, GetArg("-checklevel", DEFAULT_CHECKLEVEL),
GetArg("-checkblocks", DEFAULT_CHECKBLOCKS))) {
strLoadError = _("Corrupted block database detected");
break;
@@ -1560,7 +1561,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
uiInterface.InitMessage(_("Activating best chain..."));
// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
- if (!ActivateBestChain(state))
+ if (!ActivateBestChain(state, chainparams))
strErrors << "Failed to connect best block";
std::vector<boost::filesystem::path> vImportFiles;