aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeoffrey Tsui <tsui.geoffrey@gmail.com>2016-10-25 22:35:26 +0800
committerGeoffrey Tsui <tsui.geoffrey@gmail.com>2016-10-25 22:35:26 +0800
commitd0b01f3a859eacc51a28fc18d2ed7e361ec90833 (patch)
tree52f988b2d7f53d2624a40ba76839bfe031635908 /src
parent9bdf5269f8860b41455df1c6d82dac0d9c858e8f (diff)
downloadbitcoin-d0b01f3a859eacc51a28fc18d2ed7e361ec90833.tar.xz
Explicitly pass const CChainParams& to LoadBlockIndexDB()
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
-rw-r--r--src/main.cpp7
-rw-r--r--src/main.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 84b0108ea8..b03b509634 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1320,7 +1320,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
CleanupBlockRevFiles();
}
- if (!LoadBlockIndex()) {
+ if (!LoadBlockIndex(chainparams)) {
strLoadError = _("Error loading block database");
break;
}
diff --git a/src/main.cpp b/src/main.cpp
index 5e17ec6251..0ee54a27d5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3966,9 +3966,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
return pindexNew;
}
-bool static LoadBlockIndexDB()
+bool static LoadBlockIndexDB(const CChainParams& chainparams)
{
- const CChainParams& chainparams = Params();
if (!pblocktree->LoadBlockIndexGuts(InsertBlockIndex))
return false;
@@ -4297,10 +4296,10 @@ void UnloadBlockIndex()
fHavePruned = false;
}
-bool LoadBlockIndex()
+bool LoadBlockIndex(const CChainParams& chainparams)
{
// Load block index from databases
- if (!fReindex && !LoadBlockIndexDB())
+ if (!fReindex && !LoadBlockIndexDB(chainparams))
return false;
return true;
}
diff --git a/src/main.h b/src/main.h
index 3eab9b89da..6bd6479dcc 100644
--- a/src/main.h
+++ b/src/main.h
@@ -237,7 +237,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB
/** Initialize a new block tree database + block data on disk */
bool InitBlockIndex(const CChainParams& chainparams);
/** Load the block tree and coins database from disk */
-bool LoadBlockIndex();
+bool LoadBlockIndex(const CChainParams& chainparams);
/** Unload database information */
void UnloadBlockIndex();
/** Run an instance of the script checking thread */