Default txindex to true

This commit is contained in:
Evan Duffield 2015-07-16 07:34:40 -07:00
parent 3c8b335594
commit fc54241441
2 changed files with 4 additions and 4 deletions

View File

@ -1144,7 +1144,7 @@ bool AppInit2(boost::thread_group& threadGroup)
else if (nTotalCache > (nMaxDbCache << 20)) else if (nTotalCache > (nMaxDbCache << 20))
nTotalCache = (nMaxDbCache << 20); // total cache cannot be greater than nMaxDbCache nTotalCache = (nMaxDbCache << 20); // total cache cannot be greater than nMaxDbCache
size_t nBlockTreeDBCache = nTotalCache / 8; size_t nBlockTreeDBCache = nTotalCache / 8;
if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", false)) if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", true))
nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB
nTotalCache -= nBlockTreeDBCache; nTotalCache -= nBlockTreeDBCache;
size_t nCoinDBCache = nTotalCache / 2; // use half of the remaining cache for coindb cache size_t nCoinDBCache = nTotalCache / 2; // use half of the remaining cache for coindb cache
@ -1192,7 +1192,7 @@ bool AppInit2(boost::thread_group& threadGroup)
} }
// Check for changed -txindex state // Check for changed -txindex state
if (fTxIndex != GetBoolArg("-txindex", false)) { if (fTxIndex != GetBoolArg("-txindex", true)) {
strLoadError = _("You need to rebuild the database using -reindex to change -txindex"); strLoadError = _("You need to rebuild the database using -reindex to change -txindex");
break; break;
} }

View File

@ -58,7 +58,7 @@ CConditionVariable cvBlockChange;
int nScriptCheckThreads = 0; int nScriptCheckThreads = 0;
bool fImporting = false; bool fImporting = false;
bool fReindex = false; bool fReindex = false;
bool fTxIndex = false; bool fTxIndex = true;
bool fIsBareMultisigStd = true; bool fIsBareMultisigStd = true;
bool fCheckBlockIndex = false; bool fCheckBlockIndex = false;
unsigned int nCoinCacheSize = 5000; unsigned int nCoinCacheSize = 5000;
@ -3597,7 +3597,7 @@ bool InitBlockIndex() {
return true; return true;
// Use the provided setting for -txindex in the new database // Use the provided setting for -txindex in the new database
fTxIndex = GetBoolArg("-txindex", false); fTxIndex = GetBoolArg("-txindex", true);
pblocktree->WriteFlag("txindex", fTxIndex); pblocktree->WriteFlag("txindex", fTxIndex);
LogPrintf("Initializing databases...\n"); LogPrintf("Initializing databases...\n");