diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-02 21:09:24 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-11-02 21:09:27 +0100 |
| commit | c05db8348838422ec6bbfeef30faee36562af13d (patch) | |
| tree | fc6898fa79622feb759c78209ea9f591f7244ae3 /src | |
| parent | Merge #9042: [rpc] ParseHash: Fail when length is not 64 (diff) | |
| parent | Explicitly pass const CChainParams& to LoadBlockIndexDB() (diff) | |
| download | discoin-c05db8348838422ec6bbfeef30faee36562af13d.tar.xz discoin-c05db8348838422ec6bbfeef30faee36562af13d.zip | |
Merge #9013: Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB()
d0b01f3 Explicitly pass const CChainParams& to LoadBlockIndexDB() (Geoffrey Tsui)
Diffstat (limited to 'src')
| -rw-r--r-- | src/init.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 7 | ||||
| -rw-r--r-- | src/main.h | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp index efaf821f4..29a242a79 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1323,7 +1323,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 11abc0d17..4cc886afb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3972,9 +3972,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; @@ -4303,10 +4302,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 4c6af9514..35060e34a 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 */ |