Check pblocktree

This commit is contained in:
jl777
2019-07-02 02:20:53 -11:00
parent 710c0fc9ff
commit 7631855841

View File

@@ -6443,22 +6443,24 @@ bool InitBlockIndex() {
{ {
return true; return true;
} }
// Use the provided setting for -txindex in the new database if ( pblocktree != 0 )
fTxIndex = GetBoolArg("-txindex", true); {
pblocktree->WriteFlag("txindex", fTxIndex); // Use the provided setting for -txindex in the new database
// Use the provided setting for -addressindex in the new database fTxIndex = GetBoolArg("-txindex", true);
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX); pblocktree->WriteFlag("txindex", fTxIndex);
pblocktree->WriteFlag("addressindex", fAddressIndex); // Use the provided setting for -addressindex in the new database
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX);
// Use the provided setting for -timestampindex in the new database pblocktree->WriteFlag("addressindex", fAddressIndex);
fTimestampIndex = GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX);
pblocktree->WriteFlag("timestampindex", fTimestampIndex); // Use the provided setting for -timestampindex in the new database
fTimestampIndex = GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX);
fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX); pblocktree->WriteFlag("timestampindex", fTimestampIndex);
pblocktree->WriteFlag("spentindex", fSpentIndex);
fprintf(stderr,"fAddressIndex.%d/%d fSpentIndex.%d/%d\n",fAddressIndex,DEFAULT_ADDRESSINDEX,fSpentIndex,DEFAULT_SPENTINDEX); fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX);
LogPrintf("Initializing databases...\n"); pblocktree->WriteFlag("spentindex", fSpentIndex);
fprintf(stderr,"fAddressIndex.%d/%d fSpentIndex.%d/%d\n",fAddressIndex,DEFAULT_ADDRESSINDEX,fSpentIndex,DEFAULT_SPENTINDEX);
LogPrintf("Initializing databases...\n");
}
// Only add the genesis block if not reindexing (in which case we reuse the one already on disk) // Only add the genesis block if not reindexing (in which case we reuse the one already on disk)
if (!fReindex) { if (!fReindex) {
try { try {