Browse Source

Fix zindex flag detection

warmup
Jonathan "Duke" Leto 5 years ago
parent
commit
d03d774c18
  1. 8
      src/init.cpp
  2. 2
      src/main.cpp
  3. 1
      src/main.h

8
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;
}

2
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

1
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;

Loading…
Cancel
Save