mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Merge pull request #2783 from sipa/newtxindex
Initialize database before checking changed txindex
This commit is contained in:
commit
fd967fed89
1 changed files with 6 additions and 6 deletions
12
src/init.cpp
12
src/init.cpp
|
@ -749,18 +749,18 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||
if (!mapBlockIndex.empty() && pindexGenesisBlock == NULL)
|
||||
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
|
||||
|
||||
// Check for changed -txindex state (only necessary if we are not reindexing anyway)
|
||||
if (!fReindex && fTxIndex != GetBoolArg("-txindex", false)) {
|
||||
strLoadError = _("You need to rebuild the database using -reindex to change -txindex");
|
||||
break;
|
||||
}
|
||||
|
||||
// Initialize the block index (no-op if non-empty database was already loaded)
|
||||
if (!InitBlockIndex()) {
|
||||
strLoadError = _("Error initializing block database");
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for changed -txindex state
|
||||
if (fTxIndex != GetBoolArg("-txindex", false)) {
|
||||
strLoadError = _("You need to rebuild the database using -reindex to change -txindex");
|
||||
break;
|
||||
}
|
||||
|
||||
uiInterface.InitMessage(_("Verifying blocks..."));
|
||||
if (!VerifyDB(GetArg("-checklevel", 3),
|
||||
GetArg( "-checkblocks", 288))) {
|
||||
|
|
Loading…
Add table
Reference in a new issue