Merge pull request #435 from jl777/dev

Dev
This commit is contained in:
jl777
2017-06-03 23:28:10 +03:00
committed by GitHub
3 changed files with 8 additions and 5 deletions

View File

@@ -856,7 +856,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// if using block pruning, then disable txindex
// also disable the wallet (for now, until SPV support is implemented in wallet)
if (GetArg("-prune", 0)) {
if (GetBoolArg("-txindex", false))
if (GetBoolArg("-txindex", true))
return InitError(_("Prune mode is incompatible with -txindex."));
#ifdef ENABLE_WALLET
if (!GetBoolArg("-disablewallet", false)) {
@@ -1281,7 +1281,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
nTotalCache = std::max(nTotalCache, nMinDbCache << 20); // total cache cannot be less than nMinDbCache
nTotalCache = std::min(nTotalCache, nMaxDbCache << 20); // total cache cannot be greated than nMaxDbcache
int64_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
nTotalCache -= nBlockTreeDBCache;
int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); // use 25%-50% of the remainder for disk cache
@@ -1337,7 +1337,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
// 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");
break;
}

View File

@@ -964,9 +964,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
else //if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 )
{
hash = block.GetHash();
for (j=0; j<n; j++)
printf("%.8f ",dstr(block.vtx[0].vout[j].nValue));
printf("vout values\n");
for (j=0; j<32; j++)
printf("%02x",((uint8_t *)&hash)[j]);
printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d %s for [%s]\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height,ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]);
printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d of %d] ht.%d %s for [%s]\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,n,height,ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]);
if ( ASSETCHAINS_SYMBOL[0] != 0 || height >= activation )
return(-1);
}

View File

@@ -4020,7 +4020,7 @@ bool InitBlockIndex() {
return true;
// Use the provided setting for -txindex in the new database
fTxIndex = GetBoolArg("-txindex", false);
fTxIndex = GetBoolArg("-txindex", true);
pblocktree->WriteFlag("txindex", fTxIndex);
LogPrintf("Initializing databases...\n");