diff --git a/src/init.cpp b/src/init.cpp index 9a1f0f666..8d37f2a46 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1283,14 +1283,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Komodo is probably already running.") + " %s.", strDataDir, e.what())); } - fprintf(stderr,"About to create pidfile\n"); #ifndef _WIN32 CreatePidFile(GetPidFile(), getpid()); #endif - fprintf(stderr,"created pidfile\n"); if (GetBoolArg("-shrinkdebugfile", !fDebug)) ShrinkDebugFile(); - fprintf(stderr,"past shrinkdebugfile\n"); LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); LogPrintf("Komodo version %s (%s)\n", FormatFullVersion(), CLIENT_DATE); @@ -1669,8 +1666,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) break; } - // Check for changed -zindex state - if (fZindex != GetBoolArg("-zindex", false)) { + fprintf(stderr, "zindex=%s in block index??\n", fZindex ? "enabled" : "disabled"); + // Turning on -zindex requires a reindex, turning it off doesn't + if (fZindex && (fZindex != GetBoolArg("-zindex", false))) { strLoadError = _("You need to rebuild the database using -reindex to change -zindex"); break; } diff --git a/src/main.cpp b/src/main.cpp index 8ed78f512..524110948 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6680,7 +6680,7 @@ bool InitBlockIndex() { pblocktree->WriteFlag("addressindex", fAddressIndex); // Use the provided setting for -zindex in the new database - fAddressIndex = GetBoolArg("-zindex", DEFAULT_SHIELDEDINDEX); + fZindex = GetBoolArg("-zindex", DEFAULT_SHIELDEDINDEX); pblocktree->WriteFlag("zindex", fZindex); // Use the provided setting for -timestampindex in the new database diff --git a/src/main.h b/src/main.h index 08104a885..800f05745 100644 --- a/src/main.h +++ b/src/main.h @@ -158,6 +158,7 @@ extern bool fImporting; extern bool fReindex; extern int nScriptCheckThreads; extern bool fTxIndex; +extern bool fZindex; extern bool fIsBareMultisigStd; extern bool fCheckBlockIndex; extern bool fCheckpointsEnabled;